aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2023-01-23 15:42:07 +0100
committerUlf Hermann <ulf.hermann@qt.io>2023-01-25 17:08:37 +0000
commit6d181fc043af65dfe97c6df4ee81249010b8f746 (patch)
treea8b52dd794fcd94bf0a32a697aa8191a06d6f98e /tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp
parent518509297fd545892ed4200b7b806f87d19cc57d (diff)
QML: Allow converting any object list to QQmlListProperty
We can use QSequentialIterable for this. Pick-to: 6.5 Fixes: QTBUG-110438 Change-Id: I7e82d0f089c9bb9eab46be46dedc2db3726e64b0 Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
Diffstat (limited to 'tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp')
-rw-r--r--tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp b/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp
index b5a146ad12..9b67793ce6 100644
--- a/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp
+++ b/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp
@@ -2482,6 +2482,12 @@ void tst_QmlCppCodegen::badSequence()
other->setCousins(cousins);
QCOMPARE(self->cousins(), cousins);
QCOMPARE(self->property("m").toInt(), 2);
+
+ QQmlListProperty<Person> others
+ = self->property("others").value<QQmlListProperty<Person>>();
+ QCOMPARE(others.count(&others), 2);
+ QCOMPARE(others.at(&others, 0), cousins[0]);
+ QCOMPARE(others.at(&others, 1), cousins[1]);
}
void tst_QmlCppCodegen::enumLookup()