diff options
Diffstat (limited to 'tests/auto/qml/qqmljsscope')
-rw-r--r-- | tests/auto/qml/qqmljsscope/data/componentWrappedObjects.qml | 14 | ||||
-rw-r--r-- | tests/auto/qml/qqmljsscope/tst_qqmljsscope.cpp | 9 |
2 files changed, 22 insertions, 1 deletions
diff --git a/tests/auto/qml/qqmljsscope/data/componentWrappedObjects.qml b/tests/auto/qml/qqmljsscope/data/componentWrappedObjects.qml index e58e3f3148..9483949e02 100644 --- a/tests/auto/qml/qqmljsscope/data/componentWrappedObjects.qml +++ b/tests/auto/qml/qqmljsscope/data/componentWrappedObjects.qml @@ -7,4 +7,18 @@ Item { property Component nonWrapped3: DelegateChooser { property int nonWrapped3 } property Component wrapped: Text { property int wrapped } + + component MyInlineComponent: Item { + property Component wrapped: Text { property int wrapped } + + TableView { + delegate: Text { property int wrapped2 } + } + + TableView { + delegate: ComponentType { property int wrapped3 } + } + } + + property var wrappedInInlineComponent: MyInlineComponent {} } diff --git a/tests/auto/qml/qqmljsscope/tst_qqmljsscope.cpp b/tests/auto/qml/qqmljsscope/tst_qqmljsscope.cpp index 69fc55b05f..315b085f1e 100644 --- a/tests/auto/qml/qqmljsscope/tst_qqmljsscope.cpp +++ b/tests/auto/qml/qqmljsscope/tst_qqmljsscope.cpp @@ -240,7 +240,7 @@ void tst_qqmljsscope::componentWrappedObjects() QVERIFY(root); auto children = root->childScopes(); - QCOMPARE(children.size(), 4); + QCOMPARE(children.size(), 6); const auto isGoodType = [](const QQmlJSScope::ConstPtr &type, const QString &propertyName, bool isWrapped) { @@ -252,6 +252,13 @@ void tst_qqmljsscope::componentWrappedObjects() QVERIFY(isGoodType(children[1], u"nonWrapped2"_s, false)); QVERIFY(isGoodType(children[2], u"nonWrapped3"_s, false)); QVERIFY(isGoodType(children[3], u"wrapped"_s, true)); + QCOMPARE(children[4]->childScopes().size(), 3); + QVERIFY(isGoodType(children[4]->childScopes()[0], u"wrapped"_s, true)); + + QCOMPARE(children[4]->childScopes()[1]->childScopes().size(), 1); + QVERIFY(isGoodType(children[4]->childScopes()[1]->childScopes()[0], u"wrapped2"_s, true)); + QCOMPARE(children[4]->childScopes()[2]->childScopes().size(), 1); + QVERIFY(isGoodType(children[4]->childScopes()[2]->childScopes()[0], u"wrapped3"_s, false)); } void tst_qqmljsscope::labsQmlModelsSanity() |