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:
Tobias Hunger
2014-10-30 14:22:34 +01:00
committed by Daniel Teske
parent e8a937d82a
commit d5b4dd65d3

View File

@@ -112,23 +112,31 @@ void writeQtIncludeSection(const QStringList &qt4,
QSet<QString> qt4Only = QSet<QString>::fromList(Utils::transform(qt4, trans));
QSet<QString> qt5Only = QSet<QString>::fromList(Utils::transform(qt5, trans));
QSet<QString> common = qt4Only;
common.intersect(qt5Only);
qt4Only.subtract(common);
qt5Only.subtract(common);
if (addQtVersionCheck) {
QSet<QString> common = qt4Only;
common.intersect(qt5Only);
qtSection(common.toList(), str);
qt4Only.subtract(common);
qt5Only.subtract(common);
if (!qt4Only.isEmpty() || !qt5Only.isEmpty()) {
if (addQtVersionCheck)
writeBeginQtVersionCheck(str);
qtSection(qt5Only.toList(), str);
if (addQtVersionCheck)
str << QLatin1String("#else\n");
qtSection(qt4Only.toList(), str);
if (addQtVersionCheck)
str << QLatin1String("#endif\n");
qtSection(common.toList(), str);
if (!qt4Only.isEmpty() || !qt5Only.isEmpty()) {
if (addQtVersionCheck)
writeBeginQtVersionCheck(str);
qtSection(qt5Only.toList(), str);
if (addQtVersionCheck)
str << QLatin1String("#else\n");
qtSection(qt4Only.toList(), str);
if (addQtVersionCheck)
str << QLatin1String("#endif\n");
}
} else {
if (!qt5Only.isEmpty()) // default to Qt5
qtSection(qt5Only.toList(), str);
else
qtSection(qt4Only.toList(), str);
}
}