Commit d5b4dd65 authored by Tobias Hunger's avatar Tobias Hunger Committed by Daniel Teske
Browse files

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: default avatarDaniel Teske <daniel.teske@digia.com>
parent e8a937d8
......@@ -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);
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");
if (addQtVersionCheck) {
QSet<QString> common = qt4Only;
common.intersect(qt5Only);
qt4Only.subtract(common);
qt5Only.subtract(common);
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);
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment