diff options
author | Martin Jones <martin.jones@nokia.com> | 2010-12-23 05:01:58 (GMT) |
---|---|---|
committer | Martin Jones <martin.jones@nokia.com> | 2010-12-23 05:01:58 (GMT) |
commit | 508d52477fe16f3b425e5d3ec65584e86ed939b3 (patch) | |
tree | a59646329e915930777381c290715c82864ff488 /doc/src/snippets/declarative/gridview | |
parent | 16d08f97eaa7dd0469d7c9006546f86f1fd763f6 (diff) | |
download | Qt-508d52477fe16f3b425e5d3ec65584e86ed939b3.zip Qt-508d52477fe16f3b425e5d3ec65584e86ed939b3.tar.gz Qt-508d52477fe16f3b425e5d3ec65584e86ed939b3.tar.bz2 |
Improve docs on attached properties on view delegates.
Clarify that the properties are attached to the root of the delegate,
and must be accessed as such by child items.
Task-number: QTBUG-16193
Reviewed-by: Bea Lam
Diffstat (limited to 'doc/src/snippets/declarative/gridview')
-rw-r--r-- | doc/src/snippets/declarative/gridview/gridview.qml | 26 |
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] + } } |