#ifdefQT_DEBUG//Some codes#endif For check release mode: 代码语言:javascript 代码运行次数:0 运行 AI代码解释 #ifndefQT_DEBUG//<== Please note... if not defined//Some codes#endif 也就是说,Qt提供了针对Debug和Release模式的条件编译宏,分别对应QT
调试信息 * 声明: * 当我们在写程序的时候,往往需要写一些特殊的调试信息,同时很多时候又不愿意每次都 * 删除、添加,当然在Qt中有时候写qDebug中的D总是让人不那么舒服,如下定义成小写的感觉 * 还是挺不错的。 * * 2015-12-16 深圳 南山平山村 曾剑锋 ***/ #define debug #ifdef debug #defineqdebug...
2 Q_CORE_EXPORT_INLINE QDebug qDebug() { return QDebug(QtDebugMsg); } 3 4 #else // QT_NO_DEBUG_STREAM 5 #undef qDebug 6 inline QNoDebug qDebug() { return QNoDebug(); } 7 #define qDebug QT_NO_QDEBUG_MACRO 8 9 #ifdef QT_NO_MEMBER_TEMPLATES 10 template<typename T> 11 inli...
***/#definedebug#ifdef debug#defineqdebug(format, ...) qDebug("File:%s, Function:%s, Line:%d "format, __FILE__, __FUNCTION__, __LINE__, ##__VA_ARGS__);#else#defineqdebug(format, ...)#endif
#include #include QDebug> void printHello() { #ifdef Q_OS_WIN qDebug("Hello...Qt World on Windows!")...; } #elif defined(Q_OS_LINUX) qDebug("Hello Qt World on Linux!")...; #elif defined(Q_MV_OSX) qDebug("Hello Qt World on MacOS!")...; #else qDebug() << "We don...
#ifdef Q_OS_WIN static SysInfoWindowsImpl singleton; #elif defined(Q_OS_MAC) static SysInfoMacImpl singleton; #elif defined(Q_OS_LINUX) static SysInfoLinuxImpl singleton; #endif return singleton; } SysInfo::SysInfo(){} SysInfo::~SysInfo(){} ...
***/#definedebug#ifdef debug#defineqdebug(format, ...) qDebug("File:%s, Function:%s, Line:%d "format, __FILE__, __FUNCTION__, __LINE__, ##__VA_ARGS__);#else#defineqdebug(format, ...)#endif 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16....
#include <QDebug> int main(int argc, char *argv[]) { QApplication a(argc, argv); Widget w; #ifdef QT_NO_DEBUG //条件编译,非Debug版本运行 w.showFullScreen(); #else //条件编译,Debug版本运行 w.show(); #endif return a.exec(); ...
#ifdef MDC_LAVU_HAS_CHLAYOUT codec_ctx->ch_layout = (AVChannelLayout) AV_CHANNEL_LAYOUT_STEREO; #else codec_ctx->channel_layout = AV_CH_LAYOUT_STEREO; codec_ctx->channels = 2; #endif codec_ctx->sample_rate = 48000; } if (avcodec_open2(codec_ctx, codec, NULL) < 0) { ...