diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2022-01-13 16:18:22 +0100 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2022-01-18 15:27:24 +0000 |
commit | 116201361543983686d1e7bc42efbee84518a13b (patch) | |
tree | e8c70c6534a989abbf28fa8eda5257a2577ce1d1 /tests | |
parent | e53b255b67c4ef4674d3e8b18617956c979bde4b (diff) |
qmltc: Do not generate bindables and setters for QQmlListProperty
Assigning to a QQmlListProperty does not do what you think it does.
Change-Id: Ie6ac3208d552d8f40d9f2f4d7fb33c1cd64e4b79
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
(cherry picked from commit 134f305b7f96e1a127261bbfac9bdb1f3a22e546)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/qml/qmltc/data/listProperty.qml | 8 | ||||
-rw-r--r-- | tests/auto/qml/qmltc/tst_qmltc.cpp | 6 |
2 files changed, 12 insertions, 2 deletions
diff --git a/tests/auto/qml/qmltc/data/listProperty.qml b/tests/auto/qml/qmltc/data/listProperty.qml index 91172085f4..b2f16fe11c 100644 --- a/tests/auto/qml/qmltc/data/listProperty.qml +++ b/tests/auto/qml/qmltc/data/listProperty.qml @@ -1,11 +1,15 @@ import QtQml 2.0 QtObject { + id: a property string hello: "Hello from parent" property list<QtObject> children + property list<QtObject> ids children: [ - QtObject { property string hello: "Hello from parent.children[0]" }, - QtObject { property string hello: "Hello from parent.children[1]" } + QtObject { id: a1; property string hello: "Hello from parent.children[0]" }, + QtObject { id: a2; property string hello: "Hello from parent.children[1]" } ] + + ids: [a, a1, a2] } diff --git a/tests/auto/qml/qmltc/tst_qmltc.cpp b/tests/auto/qml/qmltc/tst_qmltc.cpp index d097e62a67..f235b96acc 100644 --- a/tests/auto/qml/qmltc/tst_qmltc.cpp +++ b/tests/auto/qml/qmltc/tst_qmltc.cpp @@ -1041,6 +1041,12 @@ void tst_qmltc::listProperty() QStringLiteral("Hello from parent.children[0]")); QCOMPARE(children.at(1)->property("hello").toString(), QStringLiteral("Hello from parent.children[1]")); + + QQmlListReference refIds(&created, "ids"); + QCOMPARE(refIds.count(), 3); + QCOMPARE(refIds.at(0), &created); + QCOMPARE(refIds.at(1), ref.at(0)); + QCOMPARE(refIds.at(2), ref.at(1)); } void tst_qmltc::listPropertiesWithTheSameName() |