From ae0195f08b37a7250fa4148f6fe8ec9a17421148 Mon Sep 17 00:00:00 2001 From: Alan Alpert Date: Wed, 10 Feb 2010 10:07:35 +0100 Subject: Attempt to clairify highlight range docs --- src/declarative/graphicsitems/qmlgraphicslistview.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/declarative/graphicsitems/qmlgraphicslistview.cpp b/src/declarative/graphicsitems/qmlgraphicslistview.cpp index a7a37e5..15064cd 100644 --- a/src/declarative/graphicsitems/qmlgraphicslistview.cpp +++ b/src/declarative/graphicsitems/qmlgraphicslistview.cpp @@ -1748,6 +1748,7 @@ void QmlGraphicsListView::setHighlightFollowsCurrentItem(bool autoHighlight) } } +//###Possibly rename these properties, since they are very useful even without a highlight? /*! \qmlproperty real ListView::preferredHighlightBegin \qmlproperty real ListView::preferredHighlightEnd @@ -1756,6 +1757,15 @@ void QmlGraphicsListView::setHighlightFollowsCurrentItem(bool autoHighlight) These properties set the preferred range of the highlight (current item) within the view. + Note that this is the correct way to influence where the + current item ends up when the list scrolls. For example, if you want the + currently selected item to be in the middle of the list, then set the + highlight range to be where the middle item would go. Then, when the list scrolls, + the currently selected item will be the item at that spot. This also applies to + when the currently selected item changes - it will scroll to within the preferred + highlight range. Furthermore, the behaviour of the current item index will occur + whether or not a highlight exists. + If highlightRangeMode is set to \e ApplyRange the view will attempt to maintain the highlight within the range, however the highlight can move outside of the range at the ends of the list -- cgit v0.12