How can I see qDebug messages while debugging in QtCreator

前端 未结 7 1558
感动是毒
感动是毒 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:00

    This is a workaround, but you could probably install your own message handler. Take a look at qInstallMsgHandler in the documentation if you have not done so already.

    I have a similar issue on Ubuntu 9.10 with Qt Creator 2.0 and Qt 4.7.0, though I don't see stdout output until the application is closed. It is as if the buffer isn't flushed. Printing to stderr shows the output in the Application output window immediately though.

    fprintf(stderr, "Test1 \n"); // Prints immediately
    fprintf(stderr, "Test2 \n\r"); // Prints immediately
    fprintf(stdout, "Test3 \n"); // Delayed until app termination
    fprintf(stdout, "Test4 \n\r"); // Delayed until app termination
    qDebug() << "Test6 \n\r"; // Does not print at all
    

提交回复
热议问题