aboutsummaryrefslogtreecommitdiffstats
path: root/examples/quick/views/package/Delegate.qml
diff options
context:
space:
mode:
Diffstat (limited to 'examples/quick/views/package/Delegate.qml')
-rw-r--r--examples/quick/views/package/Delegate.qml10
1 files changed, 8 insertions, 2 deletions
diff --git a/examples/quick/views/package/Delegate.qml b/examples/quick/views/package/Delegate.qml
index 7c73f35c3d..9f4f1946d8 100644
--- a/examples/quick/views/package/Delegate.qml
+++ b/examples/quick/views/package/Delegate.qml
@@ -52,6 +52,12 @@ import QtQuick 2.0
//! [0]
Package {
+ id: delegate
+
+ required property int upTo
+ required property int index
+ required property string display
+
Text { id: listDelegate; width: parent.width; height: 25; text: 'Empty'; Package.name: 'list' }
Text { id: gridDelegate; width: parent.width / 2; height: 50; text: 'Empty'; Package.name: 'grid' }
@@ -60,8 +66,8 @@ Package {
width: parent.width; height: 25
color: 'lightsteelblue'
- Text { text: display; anchors.centerIn: parent }
- state: root.upTo > index ? 'inGrid' : 'inList'
+ Text { text: delegate.display; anchors.centerIn: parent }
+ state: delegate.upTo > delegate.index ? 'inGrid' : 'inList'
states: [
State {
name: 'inList'