aboutsummaryrefslogtreecommitdiffstats
path: root/examples/quick/views/objectmodel/objectmodel.qml
diff options
context:
space:
mode:
Diffstat (limited to 'examples/quick/views/objectmodel/objectmodel.qml')
-rw-r--r--examples/quick/views/objectmodel/objectmodel.qml10
1 files changed, 6 insertions, 4 deletions
diff --git a/examples/quick/views/objectmodel/objectmodel.qml b/examples/quick/views/objectmodel/objectmodel.qml
index 8fc2f7c386..c9e4b8a5cd 100644
--- a/examples/quick/views/objectmodel/objectmodel.qml
+++ b/examples/quick/views/objectmodel/objectmodel.qml
@@ -70,21 +70,21 @@ Rectangle {
color: "#FFFEF0"
Text { text: "Page 1"; font.bold: true; anchors.centerIn: parent }
- Component.onDestruction: if (printDestruction) print("destroyed 1")
+ Component.onDestruction: if (root.printDestruction) print("destroyed 1")
}
Rectangle {
width: view.width; height: view.height
color: "#F0FFF7"
Text { text: "Page 2"; font.bold: true; anchors.centerIn: parent }
- Component.onDestruction: if (printDestruction) print("destroyed 2")
+ Component.onDestruction: if (root.printDestruction) print("destroyed 2")
}
Rectangle {
width: view.width; height: view.height
color: "#F4F0FF"
Text { text: "Page 3"; font.bold: true; anchors.centerIn: parent }
- Component.onDestruction: if (printDestruction) print("destroyed 3")
+ Component.onDestruction: if (root.activeFocusprintDestruction) print("destroyed 3")
}
}
@@ -112,6 +112,8 @@ Rectangle {
model: itemModel.count
Rectangle {
+ required property int index
+
width: 5; height: 5
radius: 3
color: view.currentIndex == index ? "blue" : "white"
@@ -119,7 +121,7 @@ Rectangle {
MouseArea {
width: 20; height: 20
anchors.centerIn: parent
- onClicked: view.currentIndex = index
+ onClicked: view.currentIndex = parent.index
}
}
}