aboutsummaryrefslogtreecommitdiffstats
path: root/src/qmltyperegistrar
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2021-01-18 11:27:12 +0100
committerUlf Hermann <ulf.hermann@qt.io>2021-01-18 12:13:16 +0100
commitb368caf7e1334e5e6677daea802997537bcd5c85 (patch)
tree348dc89f3e1e5536e1999eaed79874c6cdb7b03a /src/qmltyperegistrar
parentcea45ae20c4c690660b482ef8806779808503fb8 (diff)
qmltyperegistrar: Always use the local type name for "auto" elements
The local type name is assumed to be under the user's control. Previously the choice would depend on the order of classinfo objects in the metatype. Change-Id: I3199b757aaa9f04821723df1c6331ab447771ee0 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/qmltyperegistrar')
-rw-r--r--src/qmltyperegistrar/qmltypesclassdescription.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/qmltyperegistrar/qmltypesclassdescription.cpp b/src/qmltyperegistrar/qmltypesclassdescription.cpp
index ea0b70af2b..8c5e621eab 100644
--- a/src/qmltyperegistrar/qmltypesclassdescription.cpp
+++ b/src/qmltyperegistrar/qmltypesclassdescription.cpp
@@ -76,6 +76,7 @@ void QmlTypesClassDescription::collect(const QJsonObject *classDef,
}
const auto classInfos = classDef->value(QLatin1String("classInfos")).toArray();
+ const QString classDefName = classDef->value(QLatin1String("className")).toString();
for (const QJsonValue &classInfo : classInfos) {
const QJsonObject obj = classInfo.toObject();
const QString name = obj[QLatin1String("name")].toString();
@@ -100,7 +101,7 @@ void QmlTypesClassDescription::collect(const QJsonObject *classDef,
// These only apply to the original class
if (name == QLatin1String("QML.Element")) {
if (value == QLatin1String("auto"))
- elementName = classDef->value(QLatin1String("className")).toString();
+ elementName = classDefName;
else if (value != QLatin1String("anonymous"))
elementName = value;
} else if (name == QLatin1String("QML.RemovedInVersion")) {