Details
-
Bug
-
Resolution: Done
-
P2: Important
-
5.11
-
None
-
macOS (seems to be a Mac-only problem)
-
-
d868bb4f3e4b0424fd4a2989ff1c82692b0f014c b0c79a8bf41d3ae79c23e53afdcdba92ec0ec0b5
Description
If a currentItem/currentIndex exists the ItemViews (noticed with ListView) can sometimes get stuck to the current item whilst scrolling after a currentIndex is set.
This happens when you:
- click some item in the example (to set currentIndex and moveReason to SetIndex)
- scroll down really slowy (I'm using a Mac with an Apple Magic Mouse)
QQuickListView::viewportMoved uses vData.flicking und vData.moving (and hData counterparts) to detect mouse interaction. When scrolling slowly those properties are all "false" so moveReason is kept at SetIndex.
In this situation QQuickItemView::refill -> visibleItemsChanged -> updateHighlight -> updateTrackedItem -> trackedPositionChanged sometimes calls QQuickItem::setPosition with the currentItem's position which clashes with the scroll positioning.
The two changes for ---------- seem to have made this bug more obvious as they both remove lines that reset moveReason.QTBUG-62864
Looks like this is related to the changes introduced in ae01e0dbf50cb6da1967e10eb95d63313dc5aa7a (QTBUG-63026).
import QtQuick 2.10 import QtQuick.Window 2.10 Window { visible: true width: 640 height: 480 title: qsTr("Hello World") ListView { id: view anchors.fill: parent model: 10000 cacheBuffer: 0 keyNavigationEnabled: true focus: true delegate: Rectangle { id: delegate width: 300 height: 30 Text { anchors.centerIn: parent text: modelData } color: ListView.isCurrentItem ? "green" : "white" MouseArea { anchors.fill: parent onClicked: view.currentIndex = model.index } } } }
Attachments
For Gerrit Dashboard: QTBUG-67460 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
224990,5 | Fix Flickable mouse wheel handling on macOS | 5.11 | qt/qtdeclarative | Status: MERGED | +2 | 0 |
225422,1 | Fix Flickable mouse wheel handling on macOS | 5.9 | qt/qtdeclarative | Status: ABANDONED | 0 | 0 |
225722,4 | Flickable: fix another possible cause for out-of-sync moving flags | 5.11 | qt/qtdeclarative | Status: MERGED | +2 | 0 |