Enabling QDebug on Fedora Linux

When writing Qt applications, it’s helpful to use a qDebug() statement once in a while. However, I’ve recently found that qDebug() on stock Fedora no longer prints, while qWarning() does. The first thing that the internet tells you is to add CONFIG += console to your .pro file, but alas, this is not the solution. It turns out, because of the way Qt is setup on Fedora, debug output is no longer emitted on stderr (by design). Thanks to this bug report, the solution is to create the following file in either of these locations:

  • ~/.config/QtProject/qtlogging.ini (for your user only)
  • /etc/xdg/QtProject/qtlogging.ini (system-wide)
[Rules]
*.debug=true
qt.*.debug=false

The first rule enables all debug output, while the second disables Qt’s internal debug statements. This prevents a deluge of output from Qt when debugging your application.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s