aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2021-02-02 08:35:06 +0100
committerUlf Hermann <ulf.hermann@qt.io>2021-02-02 10:58:28 +0100
commitc892b26f06cd01468f16cfd19536ae4ae6501caf (patch)
treedde6e093157f59a6b07bf033b806d4c05795d505
parent19cdf0aa9e5dbfe5c9eab84d292e4dd9bd61cd5a (diff)
qmltyperegistrar: Do not add extensions to local anonymous types
If we generate a local anonymous type, then that's the local part of a QML_FOREIGN local/foreign couple. Any QML.Extended in there belong to the foreign type. Change-Id: Ic1706045eff03dd7b1b553240596ffc21818c8bd Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
-rw-r--r--src/qmltyperegistrar/qmltypesclassdescription.cpp11
-rw-r--r--tests/auto/qml/qmltyperegistrar/tst_qmltyperegistrar.cpp2
2 files changed, 3 insertions, 10 deletions
diff --git a/src/qmltyperegistrar/qmltypesclassdescription.cpp b/src/qmltyperegistrar/qmltypesclassdescription.cpp
index 2310b8b3b2..82c1c31ec2 100644
--- a/src/qmltyperegistrar/qmltypesclassdescription.cpp
+++ b/src/qmltyperegistrar/qmltypesclassdescription.cpp
@@ -112,15 +112,8 @@ void QmlTypesClassDescription::collectLocalAnonymous(
const auto classInfos = classDef->value(QLatin1String("classInfos")).toArray();
for (const QJsonValue &classInfo : classInfos) {
const QJsonObject obj = classInfo.toObject();
- const QString name = obj[QStringLiteral("name")].toString();
- const QString value = obj[QStringLiteral("value")].toString();
-
- if (name == QStringLiteral("DefaultProperty")) {
- defaultProp = obj[QLatin1String("value")].toString();
- } else if (name == QStringLiteral("QML.Extended")) {
- extensionType = value;
- collectRelated(value, types, foreign, defaultRevision);
- }
+ if (obj[QStringLiteral("name")].toString() == QStringLiteral("DefaultProperty"))
+ defaultProp = obj[obj[QStringLiteral("value")].toString()].toString();
}
collectInterfaces(classDef);
diff --git a/tests/auto/qml/qmltyperegistrar/tst_qmltyperegistrar.cpp b/tests/auto/qml/qmltyperegistrar/tst_qmltyperegistrar.cpp
index b752c4d6c1..cd3596e142 100644
--- a/tests/auto/qml/qmltyperegistrar/tst_qmltyperegistrar.cpp
+++ b/tests/auto/qml/qmltyperegistrar/tst_qmltyperegistrar.cpp
@@ -88,7 +88,7 @@ void tst_qmltyperegistrar::superAndForeignTypes()
QVERIFY(qmltypesData.contains("Property { name: \"height\"; type: \"int\"; read: \"height\"; write: \"setHeight\" }"));
QVERIFY(qmltypesData.contains("Property { name: \"width\"; type: \"int\"; read: \"width\"; write: \"setWidth\" }"));
QVERIFY(qmltypesData.contains("Method { name: \"sizeToString\"; type: \"QString\" }"));
- QVERIFY(qmltypesData.contains("extension: \"SizeValueType\""));
+ QCOMPARE(qmltypesData.count("extension: \"SizeValueType\""), 1);
}
void tst_qmltyperegistrar::accessSemantics()