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 <eike.ziller@qt.io>
This commit is contained in:
Christian Kandeler
2020-06-24 12:24:27 +02:00
parent e9fed0e536
commit 59b84c8d19
10 changed files with 13 additions and 82 deletions

View File

@@ -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 += \\

View File

@@ -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
]

View File

@@ -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 += \\

View File

@@ -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: [

View File

@@ -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 += \\

View File

@@ -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
]

View File

@@ -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 += \\

View File

@@ -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: [

View File

@@ -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/\\\"

View File

@@ -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";
}
}