summaryrefslogtreecommitdiffstats
path: root/doc/src/snippets/declarative
diff options
context:
space:
mode:
Diffstat (limited to 'doc/src/snippets/declarative')
-rw-r--r--doc/src/snippets/declarative/listview/highlight.qml12
1 files changed, 12 insertions, 0 deletions
diff --git a/doc/src/snippets/declarative/listview/highlight.qml b/doc/src/snippets/declarative/listview/highlight.qml
index 2234ee7..7970ede 100644
--- a/doc/src/snippets/declarative/listview/highlight.qml
+++ b/doc/src/snippets/declarative/listview/highlight.qml
@@ -20,6 +20,18 @@ Rectangle {
Text { text: '<b>Name:</b> ' + name }
Text { text: '<b>Number:</b> ' + number }
}
+ // Use the ListView.isCurrentItem attached property to
+ // indent the item if it is the current item.
+ states: [
+ State {
+ name: "Current"
+ when: wrapper.ListView.isCurrentItem
+ PropertyChanges { target: wrapper; x: 10 }
+ }
+ ]
+ transitions: [
+ Transition { NumberAnimation { properties: "x"; duration: 200 } }
+ ]
}
}
//! [0]