summaryrefslogtreecommitdiffstats
path: root/doc/src/snippets/declarative/gridview/gridview.qml
diff options
context:
space:
mode:
Diffstat (limited to 'doc/src/snippets/declarative/gridview/gridview.qml')
-rw-r--r--doc/src/snippets/declarative/gridview/gridview.qml26
1 files changed, 26 insertions, 0 deletions
diff --git a/doc/src/snippets/declarative/gridview/gridview.qml b/doc/src/snippets/declarative/gridview/gridview.qml
index 73e58ec..87d70de 100644
--- a/doc/src/snippets/declarative/gridview/gridview.qml
+++ b/doc/src/snippets/declarative/gridview/gridview.qml
@@ -132,6 +132,32 @@ GridView {
}
//![highlightFollowsCurrentItem]
+//![isCurrentItem]
+GridView {
+ width: 300; height: 200
+ cellWidth: 80; cellHeight: 80
+
+ Component {
+ id: contactsDelegate
+ Rectangle {
+ id: wrapper
+ width: 80
+ height: 80
+ color: GridView.isCurrentItem ? "black" : "red"
+ Text {
+ id: contactInfo
+ text: name + ": " + number
+ color: wrapper.GridView.isCurrentItem ? "red" : "black"
+ }
+ }
+ }
+
+ model: ContactModel {}
+ delegate: contactsDelegate
+ focus: true
+}
+//![isCurrentItem]
+
}
}