C++: fix cplusplus tools build with Qt 5.14

It's using QMapIterator that is disabled by default with
QT_NO_JAVA_STYLE_ITERATORS defined in cmake\QtCreatorAPIInternal.cmake.
Change to not use QMapIterator.
Another way would be to undefine QT_NO_JAVA_STYLE_ITERATORS before
including QMap, but that would not work with precompiled headers enabled

Change-Id: I26dcba64dc84b6c154f62ddd9520075b59f618b2
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
This commit is contained in:
Volodymyr Zibarov
2020-05-25 22:16:59 +03:00
parent f82c794bfb
commit bb418d2769

View File

@@ -82,14 +82,12 @@ SystemPreprocessor::SystemPreprocessor(bool verbose)
m_knownCompilers[Utils::HostOsInfo::withExecutableSuffix("cl")] m_knownCompilers[Utils::HostOsInfo::withExecutableSuffix("cl")]
= QLatin1String("/DCPLUSPLUS_WITHOUT_QT /U__BLOCKS__ /TP /E /I . /FI"); = QLatin1String("/DCPLUSPLUS_WITHOUT_QT /U__BLOCKS__ /TP /E /I . /FI");
QMapIterator<QString, QString> i(m_knownCompilers); for (const QString &key:m_knownCompilers.keys()) {
while (i.hasNext()) {
i.next();
const Utils::FilePath executablePath const Utils::FilePath executablePath
= Utils::Environment::systemEnvironment().searchInPath(i.key()); = Utils::Environment::systemEnvironment().searchInPath(key);
if (!executablePath.isEmpty()) { if (!executablePath.isEmpty()) {
m_compiler = i.key(); m_compiler = key;
m_compilerArguments = i.value().split(QLatin1Char(' '), QString::SkipEmptyParts); m_compilerArguments = m_knownCompilers[key].split(QLatin1Char(' '), QString::SkipEmptyParts);
m_compilerArguments m_compilerArguments
<< QDir::toNativeSeparators(QLatin1String(PATH_PREPROCESSOR_CONFIG)); << QDir::toNativeSeparators(QLatin1String(PATH_PREPROCESSOR_CONFIG));
break; break;