Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Call for Presentations - Qt World Summit

    Debugging with message boxes using a widget application?

    General and Desktop
    6
    7
    2948
    Loading More Posts
    • 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
      Psycho_Path last edited by

      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 Reply Quote 0
      • D
        d2uriel last edited by

        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 Reply Quote 0
        • A
          andre last edited by

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

          1 Reply Last reply Reply Quote 0
          • F
            fluca1978 last edited by

            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 Reply Quote 0
            • G
              goetz last edited by

              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 Reply Quote 0
              • F
                foxyz last edited by

                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 Reply Quote 0
                • P
                  Psycho_Path last edited by

                  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 Reply Quote 0
                  • First post
                    Last post