aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qqmllistreference
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2021-12-03 01:11:42 +0100
committerUlf Hermann <ulf.hermann@qt.io>2022-01-18 12:51:38 +0100
commit5f76fabd0609f2a61b1ca53d88b6b76bb38e919a (patch)
tree604b1edcb9d690528a114c030cf8ddf5d93f746c /tests/auto/qml/qqmllistreference
parent26a97ace7cb9491a325f400b019d40f9413f0a68 (diff)
Move propertyCache- and metaObject-related functions into QQmlMetaType
That's where the data resides. This allows us to lock the mutex only once for all those methods, and it makes a large number of engine pointers unnecessary. Finally, we can now find the element type of a QQmlListProperty without supplying an engine. Change-Id: If1ae8eafe8762a112d1ca06f9c92ab8a727d1bda Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'tests/auto/qml/qqmllistreference')
-rw-r--r--tests/auto/qml/qqmllistreference/tst_qqmllistreference.cpp12
1 files changed, 5 insertions, 7 deletions
diff --git a/tests/auto/qml/qqmllistreference/tst_qqmllistreference.cpp b/tests/auto/qml/qqmllistreference/tst_qqmllistreference.cpp
index 2ac0ee6478..2b7decfde1 100644
--- a/tests/auto/qml/qqmllistreference/tst_qqmllistreference.cpp
+++ b/tests/auto/qml/qqmllistreference/tst_qqmllistreference.cpp
@@ -880,15 +880,13 @@ void tst_qqmllistreference::compositeListProperty()
QVERIFY(!i1.isNull());
QVERIFY(!i2.isNull());
- // Without engine
+ // Without engine: We know the element type now.
QQmlListReference list1(object.data(), "items");
- QCOMPARE(list1.listElementType(), nullptr);
+ QVERIFY(list1.listElementType() != nullptr);
+ QVERIFY(list1.append(i1.data()));
+ QVERIFY(list1.replace(0, i2.data()));
- // Doesn't work because element type is unknown.
- QVERIFY(!list1.append(i1.data()));
- QVERIFY(!list1.replace(0, i2.data()));
-
- // With engine
+ // With engine: same
QQmlListReference list2(object.data(), "items", &engine);
QVERIFY(list2.listElementType() != nullptr);
QVERIFY(list2.append(i1.data()));