diff options
author | Christian Stenger <christian.stenger@qt.io> | 2021-10-12 08:29:01 +0200 |
---|---|---|
committer | Christian Stenger <christian.stenger@qt.io> | 2021-10-12 06:52:02 +0000 |
commit | 46a0abef2e193838fe9a7e30a937a022c9ebd5f8 (patch) | |
tree | 5c6c2629ff8e0bf1129c5d5fdc5ef0b5dd0ac3f0 | |
parent | b071603175eb420b44b35df946d180dbd17419b8 (diff) |
PE: Fix compile with Qt 5.14
Amends 05fa3b06e549140.
Change-Id: I26eff2c7f096b0beb77a87486bcae8faa2c137ca
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
-rw-r--r-- | src/plugins/projectexplorer/jsonwizard/jsonwizardfactory.cpp | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/src/plugins/projectexplorer/jsonwizard/jsonwizardfactory.cpp b/src/plugins/projectexplorer/jsonwizard/jsonwizardfactory.cpp index f61836cffa..431cbbf775 100644 --- a/src/plugins/projectexplorer/jsonwizard/jsonwizardfactory.cpp +++ b/src/plugins/projectexplorer/jsonwizard/jsonwizardfactory.cpp @@ -246,9 +246,18 @@ QVariant JsonWizardFactory::mergeDataValueMaps(const QVariant &valueMap, const Q { QVariantMap retVal; +#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0) + const QVariantMap &map = defaultValueMap.toMap(); + for (auto it = map.begin(), end = map.end(); it != end; ++it) + retVal.insert(it.key(), it.value()); + + const QVariantMap &map2 = valueMap.toMap(); + for (auto it = map2.begin(), end = map2.end(); it != end; ++it) + retVal.insert(it.key(), it.value()); +#else retVal.insert(defaultValueMap.toMap()); retVal.insert(valueMap.toMap()); - +#endif return retVal; } @@ -318,16 +327,12 @@ JsonWizardFactory::Page JsonWizardFactory::parsePage(const QVariant &value, QStr QVariant defaultSubData = defaultData.value(QLatin1String(DATA_KEY)); QVariant subData; - if (specifiedSubData.isNull()) { + if (specifiedSubData.isNull()) subData = defaultSubData; - } else if (specifiedSubData.type() == QVariant::Map) { - QVariantMap subDataMap; - subDataMap.insert(defaultSubData.toMap()); - subDataMap.insert(specifiedSubData.toMap()); - subData = subDataMap; - } else if (specifiedSubData.type() == QVariant::List) { + else if (specifiedSubData.type() == QVariant::Map) + subData = mergeDataValueMaps(specifiedSubData.toMap(), defaultSubData.toMap()); + else if (specifiedSubData.type() == QVariant::List) subData = specifiedSubData; - } if (!factory->validateData(typeId, subData, errorMessage)) return p; |