How can I see qDebug messages while debugging in QtCreator

前端 未结 7 1466
感动是毒
感动是毒 2021-02-04 06:38

I\'m making the transition from Eclipse CDT (with Qt integration plugin) to QtCreator 2.0 but there is still one thing that bother me with QtCreator :

When I debug in Qt

7条回答
  •  天涯浪人
    2021-02-04 07:12

    You don't have to close the application to see qDebug() messages.

    There is a tab named 3 - Application output at the very bottom of the Qt Creator. Clicking that window will show you the Application output window at the bottom of Qt Creator.

    That particular window will display the qDebug() messages as soon as they get called while the application is still running.

    Hope it helps.

    Edit:

    I am not sure whether this is an answer but it might be a good valid cause.

    From qDebug() documentation,

    The Qt implementation of these functions prints the text to the stderr output under Unix/X11 and Mac OS X. With Windows, if it is a console application, the text is sent to console; otherwise, it is sent to the debugger.

    Now Qt Creator doesn't have it's own debugger attached to it.

    From Qt Creator documentation, we have to manually install the debugger. Since you are using Windows, you need to install Debugging tools for Windows manually.. More documentation can be found here...

    Though am not used to Eclipse CDT, I assume there might be a Debugger attached to it and hence it displays the Debugging output correctly..

    Since there isn't a Debugger attached to the Qt Creator, it might be behaving strangely..

    Just give it a try..

提交回复
热议问题