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?
Asked
Active
Viewed 204 times
2 Answers
3
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.

Community
- 1
- 1

Sam Protsenko
- 14,045
- 4
- 59
- 75
0
qDebug()
don't cost any time, even if don't set CONFIG+=console
, you can use it for debugging tasks during compilation.

Adrian Cid Almaguer
- 7,815
- 13
- 41
- 63
-
How come that input/output operations don't cost any time? In fact, they take a whole of time. – Sam Protsenko May 16 '15 at 22:51