aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qqmldelegatemodel/data/contextAccessedByHandler.qml
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/qml/qqmldelegatemodel/data/contextAccessedByHandler.qml')
-rw-r--r--tests/auto/qml/qqmldelegatemodel/data/contextAccessedByHandler.qml31
1 files changed, 31 insertions, 0 deletions
diff --git a/tests/auto/qml/qqmldelegatemodel/data/contextAccessedByHandler.qml b/tests/auto/qml/qqmldelegatemodel/data/contextAccessedByHandler.qml
new file mode 100644
index 0000000000..46d7524527
--- /dev/null
+++ b/tests/auto/qml/qqmldelegatemodel/data/contextAccessedByHandler.qml
@@ -0,0 +1,31 @@
+import QtQuick 2.0
+
+Item {
+ id: root
+ width: 640
+ height: 480
+ property bool works: myView.currentItem.okay
+
+ ListView {
+ id: myView
+ model: myModel
+ anchors.fill: parent
+ delegate: Row {
+ property alias okay: image.isSelected
+ ImageToggle {
+ id: image
+ source: "glyph_16_arrow_patch"
+ isSelected: model.age < 6
+ }
+ Text {
+ text: "age:" + model.age + " selected:" + image.isSelected
+ }
+ }
+ }
+
+ ListModel {
+ id: myModel
+ ListElement { type: "Cat"; age: 3; }
+ ListElement { type: "Dog"; age: 2; }
+ }
+}