aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp')
-rw-r--r--tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp b/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp
index c9ca1387f2..ccaffbcd72 100644
--- a/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp
+++ b/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp
@@ -205,6 +205,7 @@ private slots:
void scopeVsObject();
void sequenceToIterable();
void setLookupConversion();
+ void setLookupOriginalScope();
void shadowedAsCasts();
void shadowedMethod();
void shadowedPrimitiveCmpEqNull();
@@ -4161,6 +4162,24 @@ void tst_QmlCppCodegen::setLookupConversion()
QCOMPARE(o->property("value").toInt(), 9);
}
+void tst_QmlCppCodegen::setLookupOriginalScope()
+{
+ QQmlEngine e;
+ QQmlComponent c(&e, QUrl(u"qrc:/qt/qml/TestTypes/setLookupOriginalScope.qml"_s));
+ QVERIFY2(c.isReady(), qPrintable(c.errorString()));
+ QScopedPointer<QObject> o(c.create());
+ QVERIFY(!o.isNull());
+
+ QObject *v = o->property("variable").value<QObject *>();
+ QCOMPARE(v->property("value").toInt(), 0);
+
+ QMetaObject::invokeMethod(o.data(), "trigger");
+ QObject *edit = o->property("edit").value<QObject *>();
+ QVERIFY(edit);
+ QCOMPARE(edit->property("myOutput").value<QObject *>(), v);
+ QCOMPARE(v->property("value").toInt(), 55);
+}
+
void tst_QmlCppCodegen::shadowedAsCasts()
{
QQmlEngine e;