diff options
Diffstat (limited to 'tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp')
| -rw-r--r-- | tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp | 14 |
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 90fd5f391c..d8a90309bb 100644 --- a/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp +++ b/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp @@ -146,6 +146,7 @@ private slots: void getOptionalLookupShadowed(); void globals(); void idAccess(); + void idVsMember(); void ignoredFunctionReturn(); void importsFromImportPath(); void inPlaceDecrement(); @@ -2716,6 +2717,19 @@ void tst_QmlCppCodegen::idAccess() QCOMPARE(ttt->objectName(), u"context"_s); } +void tst_QmlCppCodegen::idVsMember() +{ + QQmlEngine engine; + QQmlComponent component(&engine, QUrl(u"qrc:/qt/qml/TestTypes/idVsMember.qml"_s)); + QVERIFY2(!component.isError(), component.errorString().toUtf8()); + QScopedPointer<QObject> object(component.create()); + QVERIFY(!object.isNull()); + + QVERIFY(QRegularExpression(u"QQuickItem\\(0x[0-9a-f]+, \"blub\"\\)"_s) + .match(object->objectName()).hasMatch()); + +} + void tst_QmlCppCodegen::ignoredFunctionReturn() { QQmlEngine engine; |
