aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2025-02-04 12:01:46 +0100
committerUlf Hermann <ulf.hermann@qt.io>2025-02-21 16:20:38 +0100
commita5cb71925c31593e9d71a3e4ac621d3120311199 (patch)
tree2d72a59dce1750a9b65aaf4f8e7d08014788366f /tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp
parent8daf02d39c7d29461fed9d281c9dae0f2e34ae04 (diff)
QmlCompiler: Tighten detection of assignment to unknown properties
While those properties may be of type Component, they don't have to. We can in fact not resolve anything resembling an ID while inside one of those objects because we cannot determine the component boundaries. Amends commit dea8e38d95508acd67da997d0c2a9c91ef1bc887 Pick-to: 6.9 6.8 Fixes: QTBUG-133460 Change-Id: Iac7294166d38ce591c45c0d31b139a52eda70fc1 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Olivier De Cannière <olivier.decanniere@qt.io>
Diffstat (limited to 'tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp')
-rw-r--r--tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp b/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp
index 7bbaa0ec19..0ca624134e 100644
--- a/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp
+++ b/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp
@@ -260,6 +260,7 @@ private slots:
void typePropagationLoop();
void typePropertyClash();
void typedArray();
+ void unclearComponentBoundaries();
void undefinedResets();
void undefinedToDouble();
void unknownAttached();
@@ -5318,6 +5319,19 @@ void tst_QmlCppCodegen::typedArray()
QCOMPARE(result, 20);
}
+void tst_QmlCppCodegen::unclearComponentBoundaries()
+{
+ QQmlEngine engine;
+ QQmlComponent component(
+ &engine, QUrl(u"qrc:/qt/qml/TestTypes/unclearComponentBoundaries.qml"_s));
+
+ QVERIFY2(component.isReady(), qPrintable(component.errorString()));
+ QScopedPointer<QObject> rootObject(component.create());
+ QVERIFY(rootObject);
+
+ QCOMPARE(rootObject->objectName(), u"outer"_s);
+}
+
void tst_QmlCppCodegen::undefinedResets()
{
QQmlEngine engine;