forked from qt-creator/qt-creator
Project wizards: warn when using deprecated APIs in new projects
As discussed at QtCS, almost none of our users know that they can get warnings when they use deprecated APIs, and/or disable them altogether. A first step would be getting the relevant defines added by the new project wizards. Change-Id: I5d4260b5aa094ac2a077b7b00eaa577108e5f612 Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
@@ -112,6 +112,19 @@ void QtProjectParameters::writeProFile(QTextStream &str) const
|
||||
|
||||
if (!targetDirectory.isEmpty())
|
||||
str << "\nDESTDIR = " << targetDirectory << '\n';
|
||||
|
||||
if (qtVersionSupport != SupportQt4Only) {
|
||||
str << "\n"
|
||||
"# The following define makes your compiler emit warnings if you use\n"
|
||||
"# any feature of Qt which as 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"
|
||||
"# 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";
|
||||
}
|
||||
}
|
||||
|
||||
void QtProjectParameters::writeProFileHeader(QTextStream &str)
|
||||
|
||||
Reference in New Issue
Block a user