aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMitch Curtis <mitch.curtis@qt.io>2016-05-23 11:54:26 +0200
committerJ-P Nurmi <jpnurmi@qt.io>2016-05-23 11:10:27 +0000
commitfc1020f5842470ac4cfff94766e4d82158b67727 (patch)
tree2c6fa62e60dd351b485644471422fcc253237510 /src
parentf97a0090a0077b6057d074bdc92ca20881719c2c (diff)
ItemDelegate: Document how to use highlighted with ListView.isCurrentItem
Change-Id: Ia77e4ddf52dc2e39b95ac8acfdada629b18b0696 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/quicktemplates2/qquickitemdelegate.cpp15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/quicktemplates2/qquickitemdelegate.cpp b/src/quicktemplates2/qquickitemdelegate.cpp
index 9ff068f1..d0cc7539 100644
--- a/src/quicktemplates2/qquickitemdelegate.cpp
+++ b/src/quicktemplates2/qquickitemdelegate.cpp
@@ -86,7 +86,20 @@ QQuickItemDelegate::QQuickItemDelegate(QQuickItemDelegatePrivate &dd, QQuickItem
This property holds whether the delegate is highlighted.
A delegate can be highlighted in order to draw the user's attention towards
- it. It has no effect on keyboard interaction.
+ it. It has no effect on keyboard interaction. For example, you can
+ highlight the current item in a ListView using the following code:
+
+ \code
+ ListView {
+ id: listView
+ model: 10
+ delegate: ItemDelegate {
+ text: modelData
+ highlighted: ListView.isCurrentItem
+ onClicked: listView.currentIndex = index
+ }
+ }
+ \endcode
The default value is \c false.
*/