diff options
Diffstat (limited to 'tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp')
| -rw-r--r-- | tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp b/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp index 352660b6e3..80ea1952cd 100644 --- a/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp +++ b/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp @@ -133,6 +133,7 @@ private slots: void enumLookup(); void trivialSignalHandler(); void stringToByteArray(); + void listPropertyAsModel(); }; void tst_QmlCppCodegen::simpleBinding() @@ -2453,6 +2454,17 @@ void tst_QmlCppCodegen::stringToByteArray() QCOMPARE(person->name(), u"some data"_s); } +void tst_QmlCppCodegen::listPropertyAsModel() +{ + QQmlEngine engine; + QQmlComponent c(&engine, QUrl(u"qrc:/qt/qml/TestTypes/listPropertyAsModel.qml"_s)); + QVERIFY2(c.isReady(), qPrintable(c.errorString())); + QScopedPointer<QObject> o(c.create()); + + QQmlListReference children(o.data(), "children"); + QCOMPARE(children.count(), 5); +} + void tst_QmlCppCodegen::runInterpreted() { #ifdef Q_OS_ANDROID |
