In any release, set QT_DISABLE_DEPRECATED_BEFORE=0x000000 to enable any functions, including the ones deprecated in Qt 5.0 大概意思就是:「定义QT_DISABLE_DEPRECATED_BEFORE宏的值可以禁用具体某个版本之前已废弃或过时的方法。」比如: # 禁用Qt 5.1版本之前已废弃或过时的方法, # 这意味着可以使...
DEFINES+=QT_DISABLE_DEPRECATED_BEFORE=0x000000 这样我们就可以使用Qt 5.0版本之前已废弃或过时的方法了。 例如QAbstractItemModel类的reset()方法。 QAbstractItemModel.h节选源码: 代码语言:javascript 复制 #ifQT_DEPRECATED_SINCE(5,0)QT_DEPRECATEDvoidreset(){beginResetModel();endResetModel();}#endif...
QT -= gui CONFIG += c++11 console CONFIG -= app_bundle # You can make your code fail to compile if it uses deprecated APIs. # In order to do so, uncomment the following line. #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 ...
13 # You can also make your code fail to compile if it uses deprecated APIs. 14 # In order to do so, uncomment the following line. 15 # You can also select to disable deprecated APIs only up to a certain version of Qt. 16 #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # dis...
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 # Input HEADERS += WidgetsTest.h SOURCES += main.cpp WidgetsTest.cpp 2、生成Makefile后编译 qmake make #默认生成release 生成调试版:make debug 或同时生成两种:make all ...
# You can make your code fail to compile if it uses deprecated APIs. # In order to do so, uncomment the following line. #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 SOURCES += \ ...
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 SOURCES += \ main.cpp \ widget.cpp HEADERS += \ widget.h FORMS += \ widget.ui # Default rules for deployment. qnx: target.path = /tmp/$${TARGET}/bin else: unix:!android: target...
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 SOURCES += \ main.cpp \ widget.cpp HEADERS += \ widget.h FORMS += \ widget.ui # Default rules for deployment. qnx: target.path = /tmp/$${TARGET}/bin ...
# You can also select to disable deprecated APIs only up to a certain version of Qt. #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 # Input HEADERS += include/Algorithm.h \
QT += core gui QT += serialport greaterThan(QT_MAJOR_VERSION, 4): QT += widgets CONFIG += c++17 # You can make your code fail to compile if it uses deprecated APIs. # In order to do so, uncomment the following line. #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables...