Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Debugging with message boxes using a widget application?
QtWS25 Last Chance

Debugging with message boxes using a widget application?

Scheduled Pinned Locked Moved General and Desktop
7 Posts 6 Posters 3.4k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    Psycho_Path
    wrote on last edited by
    #1

    I'm trying to debug my application using message boxes as in VS2008, but unlike visual studios, the message boxes do not stop the code until they've been closed. Is there a way to make it so that the message box will force the user to close the box before the code progresses?

    1 Reply Last reply
    0
    • D Offline
      D Offline
      d2uriel
      wrote on last edited by
      #2

      How do you instantiate the message boxes? It seems as your are creating modeless message boxes instead of modal ones.

      "Do not judge, and you will never be mistaken." - Jean-Jacques Rousseau

      1 Reply Last reply
      0
      • A Offline
        A Offline
        andre
        wrote on last edited by
        #3

        Why do you use this way at all? Just use breakpoints for your debugger to step through your code.

        1 Reply Last reply
        0
        • F Offline
          F Offline
          fluca1978
          wrote on last edited by
          #4

          You have to use mode dialogs to block the ui thread. However, I would use a real debugger or a qDebug() set of messages instead of that boring technique.

          1 Reply Last reply
          0
          • G Offline
            G Offline
            goetz
            wrote on last edited by
            #5

            If you really want to do it this way, use the "static functions API":/doc/qt-4.8/QMessageBox.html#the-static-functions-api of QMessageBox. They are easy to use and block until the box is dismissed.

            http://www.catb.org/~esr/faqs/smart-questions.html

            1 Reply Last reply
            0
            • F Offline
              F Offline
              foxyz
              wrote on last edited by
              #6

              sums up,

              Try the debug tools like dbx on unix,gdb on linux first

              Try qDebug("(%s,%d), your debug message", FILE, LINE); or std::cout....

              use QMessageBox::information(NULL, "Debug Information", QString("%1,$2...Your debug message").arg().arg()...);

              [Edit: List formatting; mlong]

              I just know coding and coding

              1 Reply Last reply
              0
              • P Offline
                P Offline
                Psycho_Path
                wrote on last edited by
                #7

                Thank you all for the replies. Will be trying the style I wanted initially and then probably break points followed by qDebug.

                Cheers

                1 Reply Last reply
                0

                • Login

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • Users
                • Groups
                • Search
                • Get Qt Extensions
                • Unsolved