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. Qt output too verbose
Forum Update on Monday, May 27th 2025

Qt output too verbose

Scheduled Pinned Locked Moved General and Desktop
4 Posts 2 Posters 3.1k 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.
  • E Offline
    E Offline
    enutt
    wrote on last edited by
    #1

    Hi there,

    How can I adjust the verbosity of applications that use Qt? I'm using the Qt installed by package manager in Ubuntu 12.04 lts. For instance, all my applications print stuff to the terminal:

    @
    Got bus address: "unix:abstract=/tmp/dbus-uYtYuIHkwF,guid=bf09af5765943413637ce5a500000313"
    Connected to accessibility bus at: "unix:abstract=/tmp/dbus-uYtYuIHkwF,guid=bf09af5765943413637ce5a500000313"
    Registered DEC: true
    Registered event listener change listener: true
    @

    And using ui features causes more stuff to print:

    @
    QSpiAccessible::accessibleEvent not handled: "6" obj: QMenu(0x10902c0, name = "menuFile") "menuFile"
    QSpiAccessible::accessibleEvent not handled: "7" obj: QMenu(0x10902c0, name = "menuFile") "menuFile"
    @

    Is there a way to disable this log?

    Thanks.

    1 Reply Last reply
    0
    • M Offline
      M Offline
      MuldeR
      wrote on last edited by
      #2

      Install your own "dummy" message handler:

      @void myMessageOutput(QtMsgType type, const char *msg)
      {
      /do nothing, i.e. discard message completely/
      }

      int main(int argc, char **argv)
      {
      qInstallMsgHandler(myMessageOutput);

      /* ... */
      

      }@

      --

      See also:
      http://qt-project.org/doc/qt-4.8/qtglobal.html#qInstallMsgHandler

      My OpenSource software at: http://muldersoft.com/

      Qt v4.8.6 MSVC 2013, static/shared: http://goo.gl/BXqhrS

      Go visit the coop: http://youtu.be/Jay...

      1 Reply Last reply
      0
      • E Offline
        E Offline
        enutt
        wrote on last edited by
        #3

        Thanks for the answer! Although, I don't understand why this is necessary. When running the same application on two difference machines, only one of them prints messages from Qt in such a verbose way. Why is this?

        1 Reply Last reply
        0
        • M Offline
          M Offline
          MuldeR
          wrote on last edited by
          #4

          If you don't install your own message handler, the default one writes the output the STDOUT stream. On Linux, if you run a GUI application from the terminal, the STDOUT becomes visible there. If you run the GUI application without a terminal (e.g. from Nautilus) you simply don't see the STDOUT anywhere (it probably goes to /dev/null). And on Windows, the STDOUT of GUI applications is discarded anyway, even if you run them from a console.

          My OpenSource software at: http://muldersoft.com/

          Qt v4.8.6 MSVC 2013, static/shared: http://goo.gl/BXqhrS

          Go visit the coop: http://youtu.be/Jay...

          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