Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Special Interest Groups
  3. C++ Gurus
  4. [SOLVED] capture the output of a class
Forum Updated to NodeBB v4.3 + New Features

[SOLVED] capture the output of a class

Scheduled Pinned Locked Moved C++ Gurus
5 Posts 2 Posters 3.0k Views 1 Watching
  • 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.
  • T Offline
    T Offline
    terietor
    wrote on last edited by
    #1

    Hello,

    I have the following code,

    @
    void Hello::sayHello()
    {
    qDebug() << "foo";
    someOtherObject->aMethodWhichPrintsSomethingInSTDOUT();
    }
    @

    I want to capture the following output in qwidget like qtcreator does.
    The above code isn't a separate application, it lives in same application
    in which i want to print the output into the qwidget.

    Any hints?

    thanks in advance

    terietor.gr

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

      Were you looking for the qInstallMsgHandler() function?

      1 Reply Last reply
      0
      • T Offline
        T Offline
        terietor
        wrote on last edited by
        #3

        [quote author="Andre" date="1332332839"]Were you looking for the qInstallMsgHandler() function?[/quote]

        Not exactly.

        qinstallMsgHandler can give me the output from a function like,

        @void myMessageOutput(QtMsgType type, const char *msg)@

        My debug output doesn't come from methods like this, but it comes from the qDebug macro.
        Is there a way to capture that output?

        terietor.gr

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

          I think you misunderstand what these message handlers really do. All the output from qDebug, qWarning and qFatal passes through this function.

          1 Reply Last reply
          0
          • T Offline
            T Offline
            terietor
            wrote on last edited by
            #5

            I played today with the above and i figure it out.

            thanks

            terietor.gr

            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