Does Qt offer a (guaranteed) debug definition?

前端 未结 3 773
后悔当初
后悔当初 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条回答
  •  -上瘾入骨i
    2021-02-01 14:38

    For check debug mode:

    #ifdef QT_DEBUG
        //Some codes
    #endif
    

    For check release mode:

    #ifndef QT_DEBUG    //<== Please note... if not defined
        //Some codes
    #endif
    

提交回复
热议问题