diff options
author | Volodymyr Zibarov <gogan419@gmail.com> | 2020-05-25 22:16:59 +0300 |
---|---|---|
committer | Volodymyr Zibarov <gogan419@gmail.com> | 2020-05-26 05:44:31 +0000 |
commit | bb418d2769e2025525f8ae05149b719fca4122b7 (patch) | |
tree | 71c12d37d4392dae219fbc727e2ad224ee706647 | |
parent | f82c794bfb8f5529e186049f5bd2fd93d105ad51 (diff) |
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>
-rw-r--r-- | src/tools/cplusplus-shared/utils.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/tools/cplusplus-shared/utils.cpp b/src/tools/cplusplus-shared/utils.cpp index a4111b6dd9..4568513156 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<QString, QString> 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; |