diff options
| author | Ulf Hermann <ulf.hermann@qt.io> | 2025-10-10 10:47:46 +0200 |
|---|---|---|
| committer | Ulf Hermann <ulf.hermann@qt.io> | 2025-10-13 10:57:38 +0200 |
| commit | 75dcbb156b2b1dfe0bb43e3119735f26f848e0f6 (patch) | |
| tree | a3a55c0b62d83fc130a70b00f45d657c4e227271 /tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp | |
| parent | 2512ffea91bbaec41d55eea2813a365edc3160a5 (diff) | |
QtQml: Fix resolution of aliases to local aliases
When we find an alias to a local alias, we need to first check if the
target alias is already resolved. Otherwise we can't insert the source
alias, yet.
Amends commit 9e1378260a3f3a6eb4cad8d6ae47bc218e6a2b5f.
Pick-to: 6.10
Fixes: QTBUG-141059
Change-Id: If272a746595b39cb2dbc2b8cc0c2f688277cfe59
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp')
| -rw-r--r-- | tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp b/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp index 86e6c4cd16..aa76b8cd50 100644 --- a/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp +++ b/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp @@ -48,6 +48,7 @@ private slots: void accessModelMethodFromOutSide(); void aliasLookup(); void aliasToAliasResolutionSkipCorruption(); + void aliasToLocalAlias(); void ambiguousAs(); void ambiguousSignals(); void anchorsFill(); @@ -610,6 +611,27 @@ void tst_QmlCppCodegen::aliasToAliasResolutionSkipCorruption() QVERIFY(!object.isNull()); } +void tst_QmlCppCodegen::aliasToLocalAlias() +{ + QQmlEngine engine; + QQmlComponent component(&engine, QUrl(u"qrc:/qt/qml/TestTypes/aliasToLocalAlias.qml"_s)); + QVERIFY2(!component.isError(), component.errorString().toUtf8()); + QScopedPointer<QObject> object(component.create()); + QVERIFY(!object.isNull()); + + const QVariant label = object->property("label"); + QCOMPARE(label.metaType(), QMetaType::fromType<QString>()); + QVERIFY(label.toString().isEmpty()); + + const QVariant description = object->property("description"); + QCOMPARE(description.metaType(), QMetaType::fromType<QString>()); + QVERIFY(description.toString().isEmpty()); + + object->setObjectName(u"nnn"); + QCOMPARE(object->property("label").toString(), u"nnn"); + QCOMPARE(object->property("description").toString(), u"nnn"); +} + void tst_QmlCppCodegen::ambiguousAs() { QQmlEngine e; |
