.pro 文件预定义宏设置

CONFIG(release, debug|release) {
DEFINES += MYRELEASE
}
else {
DEFINES += MYDEBUG
}

原文地址:https://www.cnblogs.com/foxhengxing/p/1875535.html