[Development] qDebug, qWarning, qCritical, qFatal in Qt source code

Richard Moore rich at kde.org
Sat May 3 13:36:01 CEST 2014

On 3 May 2014 11:28, Kurt Pattyn <pattyn.kurt at gmail.com> wrote:

> Hi,
> I would like to know if there are any guidelines about using qDebug and
> friends in Qt source code?
> Recently I had to remove qWarning statements from a submit (for very
> plausible reasons), but a quick search through qtbase revealed a lot of
> qWarning statements.
> So are there any rules of thumb?

qWarning - the developer writing an app using Qt has made an error in their
code that has lead to calling Qt with invalid values, for example
connecting to a slot that does not exist.

qDebug - when used in Qt itself, this is stuff to help with debugging of
Qt. Users of Qt will often have Qt itself built without them, so don't rely
on these messages to actually appear to people developing apps.

qFatal - something is so screwed we cannot continue. Prints a message then

qCritical - similar to the above but doesn't abort.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/development/attachments/20140503/f27d9724/attachment.html>

More information about the Development mailing list