From 59b84c8d19bdaac6cdafba2bd0173113a7a1bdc8 Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Wed, 24 Jun 2020 12:24:27 +0200 Subject: [PATCH] Wizards: Update templates in regard to deprecation warnings The QT_DEPRECATED_WARNINGS macro has no effect anymore, so let's remove it along with the huge chunk of comments that took up an inordinate amount of space in the resulting project file. The concise comment for the QT_DISABLE_DEPRECATED_BEFORE macro is perfectly sufficient. Fixes: QTCREATORBUG-24244 Change-Id: I549c16c2c037bb64c2833e4807047ab3a8b2103f Reviewed-by: Eike Ziller --- .../templates/wizards/projects/consoleapp/file.pro | 9 +-------- .../templates/wizards/projects/consoleapp/file.qbs | 9 +-------- .../wizards/projects/cpplibrary/project.pro | 9 +-------- .../wizards/projects/cpplibrary/project.qbs | 11 ++--------- .../wizards/projects/qtquickapplication/app.pro | 9 +-------- .../wizards/projects/qtquickapplication/app.qbs | 9 +-------- .../projects/qtwidgetsapplication/project.pro | 9 +-------- .../projects/qtwidgetsapplication/project.qbs | 12 +++--------- .../mixed_atp/tests/auto/derived/derived.pro | 10 +--------- .../wizards/qtprojectparameters.cpp | 8 +------- 10 files changed, 13 insertions(+), 82 deletions(-) diff --git a/share/qtcreator/templates/wizards/projects/consoleapp/file.pro b/share/qtcreator/templates/wizards/projects/consoleapp/file.pro index a8ed27c2ad1..dafae633029 100644 --- a/share/qtcreator/templates/wizards/projects/consoleapp/file.pro +++ b/share/qtcreator/templates/wizards/projects/consoleapp/file.pro @@ -3,15 +3,8 @@ QT -= gui CONFIG += c++11 console CONFIG -= app_bundle -# The following define makes your compiler emit warnings if you use -# any Qt feature that has been marked deprecated (the exact warnings -# depend on your compiler). Please consult the documentation of the -# deprecated API in order to know how to port your code away from it. -DEFINES += QT_DEPRECATED_WARNINGS - -# You can also make your code fail to compile if it uses deprecated APIs. +# You can make your code fail to compile if it uses deprecated APIs. # In order to do so, uncomment the following line. -# 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 SOURCES += \\ diff --git a/share/qtcreator/templates/wizards/projects/consoleapp/file.qbs b/share/qtcreator/templates/wizards/projects/consoleapp/file.qbs index dfdd823780a..3f06621d453 100644 --- a/share/qtcreator/templates/wizards/projects/consoleapp/file.qbs +++ b/share/qtcreator/templates/wizards/projects/consoleapp/file.qbs @@ -4,15 +4,8 @@ QtApplication { cpp.cxxLanguageVersion: "c++11" cpp.defines: [ - // The following define makes your compiler emit warnings if you use - // any Qt feature that has been marked deprecated (the exact warnings - // depend on your compiler). Please consult the documentation of the - // deprecated API in order to know how to port your code away from it. - "QT_DEPRECATED_WARNINGS", - - // You can also make your code fail to compile if it uses deprecated APIs. + // You can make your code fail to compile if it uses deprecated APIs. // In order to do so, uncomment the following line. - // You can also select to disable deprecated APIs only up to a certain version of Qt. //"QT_DISABLE_DEPRECATED_BEFORE=0x060000" // disables all the APIs deprecated before Qt 6.0.0 ] diff --git a/share/qtcreator/templates/wizards/projects/cpplibrary/project.pro b/share/qtcreator/templates/wizards/projects/cpplibrary/project.pro index 8eba894fe5a..7c1be98faa9 100644 --- a/share/qtcreator/templates/wizards/projects/cpplibrary/project.pro +++ b/share/qtcreator/templates/wizards/projects/cpplibrary/project.pro @@ -17,15 +17,8 @@ DEFINES += %{LibraryDefine} CONFIG += c++11 -# The following define makes your compiler emit warnings if you use -# any Qt feature that has been marked deprecated (the exact warnings -# depend on your compiler). Please consult the documentation of the -# deprecated API in order to know how to port your code away from it. -DEFINES += QT_DEPRECATED_WARNINGS - -# You can also make your code fail to compile if it uses deprecated APIs. +# You can make your code fail to compile if it uses deprecated APIs. # In order to do so, uncomment the following line. -# 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 SOURCES += \\ diff --git a/share/qtcreator/templates/wizards/projects/cpplibrary/project.qbs b/share/qtcreator/templates/wizards/projects/cpplibrary/project.qbs index 2c51c9e116d..f314f74e477 100644 --- a/share/qtcreator/templates/wizards/projects/cpplibrary/project.qbs +++ b/share/qtcreator/templates/wizards/projects/cpplibrary/project.qbs @@ -20,16 +20,9 @@ DynamicLibrary { "QT_PLUGIN", @endif - // The following define makes your compiler emit warnings if you use - // any Qt feature that has been marked deprecated (the exact warnings - // depend on your compiler). Please consult the documentation of the - // deprecated API in order to know how to port your code away from it. - "QT_DEPRECATED_WARNINGS", - - // You can also make your code fail to compile if it uses deprecated APIs. + // You can make your code fail to compile if it uses deprecated APIs. // In order to do so, uncomment the following line. - // You can also select to disable deprecated APIs only up to a certain version of Qt. - // "QT_DISABLE_DEPRECATED_BEFORE=0x060000", // disables all the APIs deprecated before Qt 6.0.0 + //"QT_DISABLE_DEPRECATED_BEFORE=0x060000" // disables all the APIs deprecated before Qt 6.0.0 ] files: [ diff --git a/share/qtcreator/templates/wizards/projects/qtquickapplication/app.pro b/share/qtcreator/templates/wizards/projects/qtquickapplication/app.pro index 908aaa3e07a..18767f8623a 100644 --- a/share/qtcreator/templates/wizards/projects/qtquickapplication/app.pro +++ b/share/qtcreator/templates/wizards/projects/qtquickapplication/app.pro @@ -6,15 +6,8 @@ QT += quick CONFIG += c++11 -# The following define makes your compiler emit warnings if you use -# any Qt feature that has been marked deprecated (the exact warnings -# depend on your compiler). Refer to the documentation for the -# deprecated API to know how to port your code away from it. -DEFINES += QT_DEPRECATED_WARNINGS - -# You can also make your code fail to compile if it uses deprecated APIs. +# You can make your code fail to compile if it uses deprecated APIs. # In order to do so, uncomment the following line. -# 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 SOURCES += \\ diff --git a/share/qtcreator/templates/wizards/projects/qtquickapplication/app.qbs b/share/qtcreator/templates/wizards/projects/qtquickapplication/app.qbs index b22af44529d..c432214ce2f 100644 --- a/share/qtcreator/templates/wizards/projects/qtquickapplication/app.qbs +++ b/share/qtcreator/templates/wizards/projects/qtquickapplication/app.qbs @@ -13,15 +13,8 @@ CppApplication { cpp.cxxLanguageVersion: "c++14" cpp.defines: [ - // The following define makes your compiler emit warnings if you use - // any Qt feature that has been marked deprecated (the exact warnings - // depend on your compiler). Please consult the documentation of the - // deprecated API in order to know how to port your code away from it. - "QT_DEPRECATED_WARNINGS", - - // You can also make your code fail to compile if it uses deprecated APIs. + // You can make your code fail to compile if it uses deprecated APIs. // In order to do so, uncomment the following line. - // You can also select to disable deprecated APIs only up to a certain version of Qt. //"QT_DISABLE_DEPRECATED_BEFORE=0x060000" // disables all the APIs deprecated before Qt 6.0.0 ] diff --git a/share/qtcreator/templates/wizards/projects/qtwidgetsapplication/project.pro b/share/qtcreator/templates/wizards/projects/qtwidgetsapplication/project.pro index a0a237bf20e..abf62ced022 100644 --- a/share/qtcreator/templates/wizards/projects/qtwidgetsapplication/project.pro +++ b/share/qtcreator/templates/wizards/projects/qtwidgetsapplication/project.pro @@ -4,15 +4,8 @@ greaterThan(QT_MAJOR_VERSION, 4): QT += widgets CONFIG += c++11 -# The following define makes your compiler emit warnings if you use -# any Qt feature that has been marked deprecated (the exact warnings -# depend on your compiler). Please consult the documentation of the -# deprecated API in order to know how to port your code away from it. -DEFINES += QT_DEPRECATED_WARNINGS - -# You can also make your code fail to compile if it uses deprecated APIs. +# You can make your code fail to compile if it uses deprecated APIs. # In order to do so, uncomment the following line. -# 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 SOURCES += \\ diff --git a/share/qtcreator/templates/wizards/projects/qtwidgetsapplication/project.qbs b/share/qtcreator/templates/wizards/projects/qtwidgetsapplication/project.qbs index baa6326cb83..dfba4acf115 100644 --- a/share/qtcreator/templates/wizards/projects/qtwidgetsapplication/project.qbs +++ b/share/qtcreator/templates/wizards/projects/qtwidgetsapplication/project.qbs @@ -3,16 +3,10 @@ import qbs.FileInfo QtApplication { Depends { name: "Qt.widgets" } - // The following define makes your compiler emit warnings if you use - // any Qt feature that has been marked deprecated (the exact warnings - // depend on your compiler). Please consult the documentation of the - // deprecated API in order to know how to port your code away from it. - // You can also make your code fail to compile if it uses deprecated APIs. - // In order to do so, uncomment the second entry in the list. - // You can also select to disable deprecated APIs only up to a certain version of Qt. cpp.defines: [ - "QT_DEPRECATED_WARNINGS", - /* "QT_DISABLE_DEPRECATED_BEFORE=0x060000" */ // disables all the APIs deprecated before Qt 6.0.0 + // You can make your code fail to compile if it uses deprecated APIs. + // In order to do so, uncomment the following line. + //"QT_DISABLE_DEPRECATED_BEFORE=0x060000" // disables all the APIs deprecated before Qt 6.0.0 ] files: [ diff --git a/src/plugins/autotest/unit_test/mixed_atp/tests/auto/derived/derived.pro b/src/plugins/autotest/unit_test/mixed_atp/tests/auto/derived/derived.pro index 4178799aae2..ed3a5e1b14c 100644 --- a/src/plugins/autotest/unit_test/mixed_atp/tests/auto/derived/derived.pro +++ b/src/plugins/autotest/unit_test/mixed_atp/tests/auto/derived/derived.pro @@ -14,18 +14,10 @@ CONFIG -= app_bundle TEMPLATE = app -# The following define makes your compiler emit warnings if you use -# any feature of Qt which as been marked as deprecated (the exact warnings -# depend on your compiler). Please consult the documentation of the -# deprecated API in order to know how to port your code away from it. -DEFINES += QT_DEPRECATED_WARNINGS - -# You can also make your code fail to compile if you use deprecated APIs. +# You can make your code fail to compile if it uses deprecated APIs. # In order to do so, uncomment the following line. -# 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 - SOURCES += tst_derivedtest.cpp \ origin.cpp DEFINES += SRCDIR=\\\"$$PWD/\\\" diff --git a/src/plugins/qmakeprojectmanager/wizards/qtprojectparameters.cpp b/src/plugins/qmakeprojectmanager/wizards/qtprojectparameters.cpp index b649fc05fab..c5a66d9470e 100644 --- a/src/plugins/qmakeprojectmanager/wizards/qtprojectparameters.cpp +++ b/src/plugins/qmakeprojectmanager/wizards/qtprojectparameters.cpp @@ -112,14 +112,8 @@ void QtProjectParameters::writeProFile(QTextStream &str) const if (qtVersionSupport != SupportQt4Only) { str << "\n" - "# The following define makes your compiler emit warnings if you use\n" - "# any feature of Qt which has been marked as deprecated (the exact warnings\n" - "# depend on your compiler). Please consult the documentation of the\n" - "# deprecated API in order to know how to port your code away from it.\n" - "DEFINES += QT_DEPRECATED_WARNINGS\n\n" - "# You can also make your code fail to compile if you use deprecated APIs.\n" + "# You can make your code fail to compile if you use deprecated APIs.\n" "# In order to do so, uncomment the following line.\n" - "# You can also select to disable deprecated APIs only up to a certain version of Qt.\n" "#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0\n"; } }