Qt常用配置自动识别嵌入式与PC配置

greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
#if (QT_VERSION < QT_VERSION_CHECK(5, 0, 0))
#include <QTextCodec>
#endif
#if (QT_VERSION < QT_VERSION_CHECK(5, 0, 0))
    QTextCodec::setCodecForLocale(QTextCodec::codecForName("GB2312"));
    QTextCodec::setCodecForTr(QTextCodec::codecForName("GB2312"));
    QTextCodec::setCodecForCStrings(QTextCodec::codecForName("GB2312"));
#endif
equals(QT_ARCH, "arm") {
    message(equals QT_ARM == arm include screen_saver files.)
}
contains(QT_ARCH, arm) {
    DEFINES += USE_QWS
    SOURCES += screen_saver.cpp
    HEADERS  += screen_saver.h
    message(ARM  include screen_saver files.)
}


代码中 #ifdef USE_QWS 再去使能嵌入式编译

你可能感兴趣的:(qt)