Does Qt offer a (guaranteed) debug definition?

前端 未结 3 833
后悔当初
后悔当初 2021-02-01 14:26

Does anyone know an officially supported way to include debug-build only code in Qt? For example:

#ifdef QT_DEBUG
// do something
#endif

Basica

3条回答
  •  轮回少年
    2021-02-01 14:43

    Qt defines QT_NO_DEBUG for release builds. Otherwise QT_DEBUG is defined.

    Of course you are free to specify any DEFINES in your .pro files and scope them for either debug or release.

提交回复
热议问题