From f6fc35b45b449fe7aaca3237f29393a12fc3f90c Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Mon, 1 Feb 2021 15:03:19 +0100 Subject: QmlCompiler: Allow for multiple extensions per object Previously, the assumption was that each object could only have a single extension object. As proven by the new qqmllanguage test this is not the case. Each registered object in the type hierarchy can have its own extension. Therefore, adjust the algorithms that generate qmltypes and iterate the extension objects when analyzing them. This leads us to the realization that anonymous types can in fact meaningfully carry extensions and implement interfaces. Adapt qmltyperegistrar accordingly. For the test to compile, however, we need to realize that the class declaring interfaces needs to befriend all potential subclass's QmlInterface structs. Fix that, too. The rabbit hole went deep. Change-Id: Ia451897e927e03b95c3062e829edf1dfcd216613 Reviewed-by: Fabian Kosmale --- tests/auto/qml/qmllint/tst_qmllint.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'tests/auto/qml/qmllint/tst_qmllint.cpp') diff --git a/tests/auto/qml/qmllint/tst_qmllint.cpp b/tests/auto/qml/qmllint/tst_qmllint.cpp index 895953c2f7..b874d3cc6f 100644 --- a/tests/auto/qml/qmllint/tst_qmllint.cpp +++ b/tests/auto/qml/qmllint/tst_qmllint.cpp @@ -337,6 +337,7 @@ void TestQmllint::cleanQmlCode_data() QTest::newRow("goodAliasObject") << QStringLiteral("goodAliasObject.qml"); QTest::newRow("jsmoduleimport") << QStringLiteral("jsmoduleimport.qml"); QTest::newRow("overridescript") << QStringLiteral("overridescript.qml"); + QTest::newRow("multiExtension") << QStringLiteral("multiExtension.qml"); } void TestQmllint::cleanQmlCode() -- cgit v1.2.3