Nyaruko Nyaruko - 9 months ago 54
C++ Question

Will qDebug cost time when CONFIG += console is not set?

qDebug() print out text messages on the console, according to what I know print out text message is expensive.
But if I dont set CONFIG += console, will it still cost time?
Otherwise I need to comment it one by one by hand?


From Qt documentation:

This function does nothing if QT_NO_DEBUG_OUTPUT was defined during compilation.

So if you want to disable qDebug() in release build, you can add next line to your .pro file (taken from here):

CONFIG(release, debug|release):DEFINES += QT_NO_DEBUG_OUTPUT

See also this question.