2

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?

Nyaruko
  • 4,329
  • 9
  • 54
  • 105

2 Answers2

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