Details
-
Bug
-
Resolution: Done
-
P3: Somewhat important
-
4.7.0
-
None
-
acec7123d383840d66fa63e84d0d0a0b72820496
Description
Scrolling to the end of a list that keeps its highlight centered, then starting a
flicking action from a point beyond the last item make the list jump. This does
not happen if starting a flick from a point ahead of the first item.
import Qt 4.7 Rectangle { id: appRect width: 480 height: 600 property int itemWidth: 200 ListView { id: list anchors.fill: parent model: 8 delegate: delegateItem orientation: "Horizontal" snapMode: "SnapToItem" highlightRangeMode: "StrictlyEnforceRange" // keep highlight visible flickDeceleration: 5000 // center the highlighted item preferredHighlightBegin: (appRect.width-itemWidth)/2 preferredHighlightEnd: (appRect.width-itemWidth)/2 + itemWidth } Component { id: delegateItem Rectangle { id: item color: (index%2 == 0) ? "blue" : "yellow" width: itemWidth height: 350 y: (list.height-height) / 2 // centered vertically Text { anchors.centerIn: parent; font.pixelSize: 100; text: index; } states: State { name: "highlighted" when: item.ListView.isCurrentItem PropertyChanges {target:item; z: 100; scale: 1.25} } transitions: Transition { SequentialAnimation { PauseAnimation { duration: 250} ParallelAnimation { PropertyAction { target: item; property: "z"; } // put highlighted item in front NumberAnimation { target: item; properties: "scale"; duration: 200; } } } } } } }