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. Trapping QT debugging messages
Forum Updated to NodeBB v4.3 + New Features

Trapping QT debugging messages

Scheduled Pinned Locked Moved Unsolved General and Desktop
7 Posts 2 Posters 612 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.
  • D Offline
    D Offline
    drmhkelley
    wrote on last edited by
    #1

    In the discussion of a recent post (Strange errors from paintEngine) I learned how to use qInstallMessageHandler to catch Qt error messages in the debugger. That hasn't worked for me with a new problem I've encountered. While the "release" version of the app issues the warnings, the "debug" version does not. Any clue why these messages might be suppressed, or even not encountered, in the debug version but not the release version?

    JonBJ 1 Reply Last reply
    0
    • D drmhkelley

      In the discussion of a recent post (Strange errors from paintEngine) I learned how to use qInstallMessageHandler to catch Qt error messages in the debugger. That hasn't worked for me with a new problem I've encountered. While the "release" version of the app issues the warnings, the "debug" version does not. Any clue why these messages might be suppressed, or even not encountered, in the debug version but not the release version?

      JonBJ Online
      JonBJ Online
      JonB
      wrote on last edited by JonB
      #2

      @drmhkelley
      Then it sounds like only the debug version compiles in the code which calls the Qt message handler. Likely look for macros like Q_ASSERT, assert or similar.

      EDIT

      While the "release" version of the app issues the warnings, the "debug" version does not

      Oh! It's usually the other way round! Anyway, look for symbols defined differently in Debug vs Release builds. Or, just possibly, a problem is being detected only in Release code.

      D 2 Replies Last reply
      0
      • JonBJ JonB

        @drmhkelley
        Then it sounds like only the debug version compiles in the code which calls the Qt message handler. Likely look for macros like Q_ASSERT, assert or similar.

        EDIT

        While the "release" version of the app issues the warnings, the "debug" version does not

        Oh! It's usually the other way round! Anyway, look for symbols defined differently in Debug vs Release builds. Or, just possibly, a problem is being detected only in Release code.

        D Offline
        D Offline
        drmhkelley
        wrote on last edited by
        #3

        @JonB - Already checked that. The only difference for compiling release vs debug packages (.cpp to .o) is that release has "-DQT_NO_DEBUG" and debug has "-DQT_QML_DEBUG" (not sure why);

        The only difference for linking is the use of debug libraries.

        1 Reply Last reply
        0
        • JonBJ JonB

          @drmhkelley
          Then it sounds like only the debug version compiles in the code which calls the Qt message handler. Likely look for macros like Q_ASSERT, assert or similar.

          EDIT

          While the "release" version of the app issues the warnings, the "debug" version does not

          Oh! It's usually the other way round! Anyway, look for symbols defined differently in Debug vs Release builds. Or, just possibly, a problem is being detected only in Release code.

          D Offline
          D Offline
          drmhkelley
          wrote on last edited by
          #4

          @JonB - I don't use Q_ASSERT or assert in my code, so it must come from somewhere in the bowels of Qt. I'm hesitant to go down that road without some better sort of map than I have now.

          JonBJ 1 Reply Last reply
          0
          • D drmhkelley

            @JonB - I don't use Q_ASSERT or assert in my code, so it must come from somewhere in the bowels of Qt. I'm hesitant to go down that road without some better sort of map than I have now.

            JonBJ Online
            JonBJ Online
            JonB
            wrote on last edited by
            #5

            @drmhkelley
            Then is it indeed

            Or, just possibly, a problem is being detected only in Release code.

            ?

            D 1 Reply Last reply
            0
            • JonBJ JonB

              @drmhkelley
              Then is it indeed

              Or, just possibly, a problem is being detected only in Release code.

              ?

              D Offline
              D Offline
              drmhkelley
              wrote on last edited by
              #6

              @JonB - how would one know?

              JonBJ 1 Reply Last reply
              0
              • D drmhkelley

                @JonB - how would one know?

                JonBJ Online
                JonBJ Online
                JonB
                wrote on last edited by
                #7

                @drmhkelley
                You can't know for sure, unless you write perfect code in the first place. Depends on the code and what the messages are. Find the message text, track it down.

                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