Qt是否提供(保证)调试定义? [英] Does Qt offer a (guaranteed) debug definition?
问题描述
#ifdef QT_DEBUG
//做某事
#endif
基本上像Q_ASSERT,但更复杂的测试。
我可以'似乎找到任何说明Qt框架保证定义一个调试宏的文档。如果没有,那么将是一个明智的,非官方的方式来实现这个功能项目?
p> Qt为发布版本定义了 QT_NO_DEBUG
。否则 QT_DEBUG
被定义。
当然,您可以自由指定任何 DEFINES
在.pro文件中,并为
debug
或发布
Does anyone know an officially supported way to include debug-build only code in Qt? For example:
#ifdef QT_DEBUG
// do something
#endif
Basically like Q_ASSERT but for more complex tests.
I can't seem to find any documentation which says that the Qt framework guarantees to define a debug macro. If there isn't, what would be a sensible unofficial way to implement this feature project wide?
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
.
这篇关于Qt是否提供(保证)调试定义?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!