diff options
| author | Ulf Hermann <ulf.hermann@qt.io> | 2022-07-25 14:24:19 +0200 |
|---|---|---|
| committer | Ulf Hermann <ulf.hermann@qt.io> | 2022-07-26 21:17:28 +0200 |
| commit | 6ea2a1cdb728635f9bd3cf239f751d4e88610881 (patch) | |
| tree | 8db607732c7fcd1ea8dd4d0692f1d1046a4fa6a8 /tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp | |
| parent | aa9412615bf7cee3fdcfd3854ba73f4cb3ed93b7 (diff) | |
QQmlListAccessor: Accept QQmlListProperty
So far we have only accepted QQmlListReference. However, we can also
pass a QQmlListProperty around as value.
Pick-to: 6.2 6.3 6.4
Fixes: QTBUG-105137
Change-Id: I7d4cd3048b62594298f91013c4cda5ec864a28df
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
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 |
