From bb418d2769e2025525f8ae05149b719fca4122b7 Mon Sep 17 00:00:00 2001 From: Volodymyr Zibarov Date: Mon, 25 May 2020 22:16:59 +0300 Subject: [PATCH] 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 --- src/tools/cplusplus-shared/utils.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/tools/cplusplus-shared/utils.cpp b/src/tools/cplusplus-shared/utils.cpp index a4111b6dd95..4568513156a 100644 --- a/src/tools/cplusplus-shared/utils.cpp +++ b/src/tools/cplusplus-shared/utils.cpp @@ -82,14 +82,12 @@ SystemPreprocessor::SystemPreprocessor(bool verbose) m_knownCompilers[Utils::HostOsInfo::withExecutableSuffix("cl")] = QLatin1String("/DCPLUSPLUS_WITHOUT_QT /U__BLOCKS__ /TP /E /I . /FI"); - QMapIterator i(m_knownCompilers); - while (i.hasNext()) { - i.next(); + for (const QString &key:m_knownCompilers.keys()) { const Utils::FilePath executablePath - = Utils::Environment::systemEnvironment().searchInPath(i.key()); + = Utils::Environment::systemEnvironment().searchInPath(key); if (!executablePath.isEmpty()) { - m_compiler = i.key(); - m_compilerArguments = i.value().split(QLatin1Char(' '), QString::SkipEmptyParts); + m_compiler = key; + m_compilerArguments = m_knownCompilers[key].split(QLatin1Char(' '), QString::SkipEmptyParts); m_compilerArguments << QDir::toNativeSeparators(QLatin1String(PATH_PREPROCESSOR_CONFIG)); break;