forked from qt-creator/qt-creator
QtSupport: Default to Qt5 module names
When adding includes for Qt classes with module names: Default to Qt5 names (if no Qt version ifdef is wanted). Task-number: QTCREATORBUG-13267 Change-Id: I214315589e4876215ff5993aa91359f11c5cf8f6 Reviewed-by: Daniel Teske <daniel.teske@digia.com>
This commit is contained in:
committed by
Daniel Teske
parent
e8a937d82a
commit
d5b4dd65d3
@@ -112,9 +112,11 @@ void writeQtIncludeSection(const QStringList &qt4,
|
|||||||
|
|
||||||
QSet<QString> qt4Only = QSet<QString>::fromList(Utils::transform(qt4, trans));
|
QSet<QString> qt4Only = QSet<QString>::fromList(Utils::transform(qt4, trans));
|
||||||
QSet<QString> qt5Only = QSet<QString>::fromList(Utils::transform(qt5, trans));
|
QSet<QString> qt5Only = QSet<QString>::fromList(Utils::transform(qt5, trans));
|
||||||
QSet<QString> common = qt4Only;
|
|
||||||
|
|
||||||
|
if (addQtVersionCheck) {
|
||||||
|
QSet<QString> common = qt4Only;
|
||||||
common.intersect(qt5Only);
|
common.intersect(qt5Only);
|
||||||
|
|
||||||
qt4Only.subtract(common);
|
qt4Only.subtract(common);
|
||||||
qt5Only.subtract(common);
|
qt5Only.subtract(common);
|
||||||
|
|
||||||
@@ -130,6 +132,12 @@ void writeQtIncludeSection(const QStringList &qt4,
|
|||||||
if (addQtVersionCheck)
|
if (addQtVersionCheck)
|
||||||
str << QLatin1String("#endif\n");
|
str << QLatin1String("#endif\n");
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
if (!qt5Only.isEmpty()) // default to Qt5
|
||||||
|
qtSection(qt5Only.toList(), str);
|
||||||
|
else
|
||||||
|
qtSection(qt4Only.toList(), str);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
QTCREATOR_UTILS_EXPORT
|
QTCREATOR_UTILS_EXPORT
|
||||||
|
|||||||
Reference in New Issue
Block a user