It seems that at the time of writing, some GNU/Linux distributions will not show the output of qDebug()
calls by default within the Application Output section of Qt Creator. This happens despite qWarning()
working perfectly.
The issue here lies in /etc/xdg/QtProject/qtlogging.ini
:
[Rules]
*.debug=false
According to Kevin Kofler at Fedora:
This is by design. Our users do not want to get spammed with debugging output by default. It is easy for developers to enable it. (We are also working on packaging the GUI KDE now ships for editing qtlogging.ini to make it even easier.)
Do not edit the file within /etc/xdg/QtProject
as it will likely get changed back when your package manager updates whatever provides the file. Instead we will add a new qtlogging.ini
local to the home directory of the user that you run Qt Creator on.
Add the following contents to ~/.config/QtProject/qtlogging.ini
:
[Rules]
*.debug=true
qt.*.debug=false
Here we set *.debug=true
to allow all debug output. Then we set qt.*.debug=false
to prevent us from receiving the verbose output from Qt itself rather than the qDebug()
calls within your project.
It is worth noting that the file above will simply change Qt Creator to its default behavior if you do not already have a qtlogging.ini
provided by your distribution. If you find your distribution removes this file, your new qtlogging.ini
in ~/.config
is redundant.