Qt qDebug not working with QConsoleApplication or QApplication

marius_linux picture marius_linux · Jun 1, 2015 · Viewed 7.1k times · Source

I currently have a terribly annoying problem while developing programs using Qt and Qt Creator. Whenever I try using qDebug() with a QCoreApplication or QApplication instantiated before using qDebug(), there isn't any output, whether I run the program in Qt Creator or from a normal shell(I'm using Fedora Linux btw). For example, even the following simple code fails:

int main(int argc, char *argv[])
{
    QCoreApplication a(argc, argv);
    qDebug() << "TestOutput!" << endl;
}

Does anybody know what to do about this problem? Thanks in advance, Marius

Answer

Mathias picture Mathias · Aug 17, 2015

For better formatting, I add this new solution, marius still found it himself in this bugzilla.

Edit ~/.config/QtProject/qtlogging.ini and add:

[Rules]
*.debug=true
qt.qpa.input*.debug=false

The last line is to disable spammy debug logging for moved mouse messages.