diff options
Diffstat (limited to 'src/declarative/graphicsitems/qdeclarativelistview.cpp')
-rw-r--r-- | src/declarative/graphicsitems/qdeclarativelistview.cpp | 42 |
1 files changed, 27 insertions, 15 deletions
diff --git a/src/declarative/graphicsitems/qdeclarativelistview.cpp b/src/declarative/graphicsitems/qdeclarativelistview.cpp index 0f3ee61..8485071 100644 --- a/src/declarative/graphicsitems/qdeclarativelistview.cpp +++ b/src/declarative/graphicsitems/qdeclarativelistview.cpp @@ -1164,6 +1164,7 @@ void QDeclarativeListViewPrivate::flick(AxisData &data, qreal minExtent, qreal m moveReason = Mouse; if ((!haveHighlightRange || highlightRange != QDeclarativeListView::StrictlyEnforceRange) && snapMode == QDeclarativeListView::NoSnap) { + correctFlick = true; QDeclarativeFlickablePrivate::flick(data, minExtent, maxExtent, vSize, fixupCallback, velocity); return; } @@ -1313,6 +1314,9 @@ void QDeclarativeListViewPrivate::flick(AxisData &data, qreal minExtent, qreal m In this case ListModel is a handy way for us to test our UI. In practice the model would be implemented in C++, or perhaps via a SQL data source. + Delegates are instantiated as needed and may be destroyed at any time. + State should \e never be stored in a delegate. + \bold Note that views do not enable \e clip automatically. If the view is not clipped by another item or the screen, it will be necessary to set \e {clip: true} in order to have the out of view items clipped @@ -1391,7 +1395,7 @@ QDeclarativeListView::~QDeclarativeListView() id: wrapper ListView.onRemove: SequentialAnimation { PropertyAction { target: wrapper; property: "ListView.delayRemove"; value: true } - NumberAnimation { target: wrapper; property: "scale"; to: 0; duration: 250; easing.type: "InOutQuad" } + NumberAnimation { target: wrapper; property: "scale"; to: 0; duration: 250; easing.type: Easing.InOutQuad } PropertyAction { target: wrapper; property: "ListView.delayRemove"; value: false } } } @@ -1690,17 +1694,17 @@ void QDeclarativeListView::setHighlightFollowsCurrentItem(bool autoHighlight) 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 + If highlightRangeMode is set to \e ListView.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 or due to a mouse interaction. - If highlightRangeMode is set to \e StrictlyEnforceRange the highlight will never + If highlightRangeMode is set to \e ListView.StrictlyEnforceRange the highlight will never move outside of the range. This means that the current item will change if a keyboard or mouse action would cause the highlight to move outside of the range. - The default value is \e NoHighlightRange. + The default value is \e ListView.NoHighlightRange. Note that a valid range requires preferredHighlightEnd to be greater than or equal to preferredHighlightBegin. @@ -1780,9 +1784,9 @@ void QDeclarativeListView::setSpacing(qreal spacing) Possible values are \c Vertical (default) and \c Horizontal. - Vertical Example: + ListView.Vertical Example: \image trivialListView.png - Horizontal Example: + ListView.Horizontal Example: \image ListViewHorizontal.png */ QDeclarativeListView::Orientation QDeclarativeListView::orientation() const @@ -1835,11 +1839,19 @@ void QDeclarativeListView::setWrapEnabled(bool wrap) /*! \qmlproperty int ListView::cacheBuffer - This property holds the number of off-screen pixels to cache. - - This property determines the number of pixels above the top of the list - and below the bottom of the list to cache. Setting this value can make - scrolling the list smoother at the expense of additional memory usage. + This property determines whether delegates are retained outside the + visible area of the view. + + If non-zero the view will keep as many delegates + instantiated as will fit within the buffer specified. For example, + if in a vertical view the delegate is 20 pixels high and \c cacheBuffer is + set to 40, then up to 2 delegates above and 2 delegates below the visible + area may be retained. + + Setting this value can make scrolling the list smoother at the expense + of additional memory usage. It is not a substitute for creating efficient + delegates; the fewer elements in a delegate, the faster a view may be + scrolled. */ int QDeclarativeListView::cacheBuffer() const { @@ -1996,17 +2008,17 @@ void QDeclarativeListView::setHighlightResizeDuration(int duration) The allowed values are: \list - \o NoSnap (default) - the view will stop anywhere within the visible area. - \o SnapToItem - the view will settle with an item aligned with the start of + \o ListView.NoSnap (default) - the view will stop anywhere within the visible area. + \o ListView.SnapToItem - the view will settle with an item aligned with the start of the view. - \o SnapOneItem - the view will settle no more than one item away from the first + \o ListView.SnapOneItem - the view will settle no more than one item away from the first visible item at the time the mouse button is released. This mode is particularly useful for moving one page at a time. \endlist snapMode does not affect the currentIndex. To update the currentIndex as the list is moved set \e highlightRangeMode - to \e StrictlyEnforceRange. + to \e ListView.StrictlyEnforceRange. \sa highlightRangeMode */ |