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.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp b/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp
index 1f7e7eeb1f..208ca15444 100644
--- a/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp
+++ b/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp
@@ -113,6 +113,7 @@ private slots:
void getOptionalLookup();
void getOptionalLookup_data();
void getOptionalLookupOnQJSValueNonStrict();
+ void getOptionalLookupShadowed();
void globals();
void idAccess();
void ignoredFunctionReturn();
@@ -2127,6 +2128,18 @@ void tst_QmlCppCodegen::getOptionalLookupOnQJSValueNonStrict()
QVERIFY(o->property("b").toBool());
}
+void tst_QmlCppCodegen::getOptionalLookupShadowed()
+{
+ QQmlEngine engine;
+ const QUrl document(u"qrc:/qt/qml/TestTypes/GetOptionalLookupShadowed.qml"_s);
+ QQmlComponent c(&engine, document);
+ QVERIFY2(c.isReady(), qPrintable(c.errorString()));
+ QScopedPointer<QObject> o(c.create());
+ QVERIFY(o);
+
+ QCOMPARE(o->property("res").toString(), "a");
+}
+
void tst_QmlCppCodegen::globals()
{
QQmlEngine engine;