diff options
author | Tarja Sundqvist <tarja.sundqvist@qt.io> | 2023-03-23 16:00:07 +0200 |
---|---|---|
committer | Tarja Sundqvist <tarja.sundqvist@qt.io> | 2023-03-23 16:00:07 +0200 |
commit | 19ed7973a311a8d42d3a558bb551230e902ce9b9 (patch) | |
tree | 9832c0cc796722f85579e25fd50cc38b65e6ef6c /tests/auto/qml/qqmlinstantiator/data/activeModelChangeInteraction.qml | |
parent | f5701f0def37fcc0c2b38ae9552eb3a896a34687 (diff) | |
parent | a5635345175e667601c8b6a344508c4d4ebb0f9d (diff) |
Merge remote-tracking branch 'origin/tqtc/lts-5.15.9' into tqtc/lts-5.15-opensourcev5.15.9-lts-lgpl
Change-Id: I91d2b178e7111d0802ea973bccf230b264c30c96
Diffstat (limited to 'tests/auto/qml/qqmlinstantiator/data/activeModelChangeInteraction.qml')
-rw-r--r-- | tests/auto/qml/qqmlinstantiator/data/activeModelChangeInteraction.qml | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/tests/auto/qml/qqmlinstantiator/data/activeModelChangeInteraction.qml b/tests/auto/qml/qqmlinstantiator/data/activeModelChangeInteraction.qml new file mode 100644 index 0000000000..2797566ad2 --- /dev/null +++ b/tests/auto/qml/qqmlinstantiator/data/activeModelChangeInteraction.qml @@ -0,0 +1,39 @@ +import QtQuick 2.15 +import QtQml.Models 2.15 + +Item { + id: root + property int instanceCount: 0 + property alias active: instantiator.active + + ListModel { + id: listmodel + + dynamicRoles: true + } + + Component.onCompleted: { + listmodel.insert(listmodel.count, {name: "one"}) + listmodel.insert(listmodel.count, {name: "two"}) + listmodel.insert(listmodel.count, {name: "three"}) + } + + Instantiator { + id: instantiator + + active: false + + model: listmodel + + delegate: Text { + width: 100 + height: 20 + + text: name + + Component.onCompleted: ++root.instanceCount + } + + } +} + |