diff options
author | David Skoland <davidskoland@gmail.com> | 2020-10-28 13:25:38 +0100 |
---|---|---|
committer | David Skoland <david.skoland@qt.io> | 2020-10-28 14:44:47 +0100 |
commit | 27bd9cab73a1e7e3d66e6025ace8510f932c5df8 (patch) | |
tree | 4c92072c9a15d681d1c6cdca97f35db88ca7dae2 /src/qmltyperegistrar/qmltypesclassdescription.cpp | |
parent | 535adf8d9f6d26d4e9598a9276f23f938fcc7753 (diff) |
Standardize QJsonArray iteration
When using refs as loop variables, the clang compiler complains (with
default settings). This prevents that. Note that QJsonValueRef is used
"behind the scenes", which makes this iteration method correct.
Change-Id: I5a5f58ca8ad3887bce2009231cbae5a57c107697
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Diffstat (limited to 'src/qmltyperegistrar/qmltypesclassdescription.cpp')
-rw-r--r-- | src/qmltyperegistrar/qmltypesclassdescription.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/qmltyperegistrar/qmltypesclassdescription.cpp b/src/qmltyperegistrar/qmltypesclassdescription.cpp index 9f58d824fe..20f5d4c46a 100644 --- a/src/qmltyperegistrar/qmltypesclassdescription.cpp +++ b/src/qmltyperegistrar/qmltypesclassdescription.cpp @@ -35,7 +35,7 @@ static void collectExtraVersions(const QJsonObject *component, const QString &ke QList<QTypeRevision> &extraVersions) { const QJsonArray &items = component->value(key).toArray(); - for (const QJsonValue &item : items) { + for (const QJsonValue item : items) { const QJsonObject obj = item.toObject(); const auto revision = obj.find(QLatin1String("revision")); if (revision != obj.end()) { @@ -67,7 +67,7 @@ void QmlTypesClassDescription::collect(const QJsonObject *classDef, if (file.isEmpty() && classDef->value(QLatin1String("registerable")).toBool()) file = classDef->value(QLatin1String("inputFile")).toString(); const auto classInfos = classDef->value(QLatin1String("classInfos")).toArray(); - for (const QJsonValue &classInfo : classInfos) { + for (const QJsonValue classInfo : classInfos) { const QJsonObject obj = classInfo.toObject(); const QString name = obj[QLatin1String("name")].toString(); const QString value = obj[QLatin1String("value")].toString(); @@ -108,7 +108,7 @@ void QmlTypesClassDescription::collect(const QJsonObject *classDef, classDef = other; // Foreign type can have a default property or an attached types const auto classInfos = classDef->value(QLatin1String("classInfos")).toArray(); - for (const QJsonValue &classInfo : classInfos) { + for (const QJsonValue classInfo : classInfos) { const QJsonObject obj = classInfo.toObject(); const QString foreignName = obj[QLatin1String("name")].toString(); const QString foreignValue = obj[QLatin1String("value")].toString(); @@ -136,11 +136,11 @@ void QmlTypesClassDescription::collect(const QJsonObject *classDef, auto supers = classDef->value(QLatin1String("superClasses")).toArray(); if (classDef != origClassDef) { const QJsonArray origSupers = origClassDef->value(QLatin1String("superClasses")).toArray(); - for (const QJsonValue &origSuper : origSupers) + for (const QJsonValue origSuper : origSupers) supers.append(origSuper); } - for (const QJsonValue &superValue : qAsConst(supers)) { + for (const QJsonValue superValue : qAsConst(supers)) { const QJsonObject superObject = superValue.toObject(); if (superObject[QLatin1String("access")].toString() == QLatin1String("public")) { const QString superName = superObject[QLatin1String("name")].toString(); |