Details
-
Bug
-
Resolution: Incomplete
-
P3: Somewhat important
-
None
-
5.7.0
-
Windows 7
Description
import QtQuick 2.7 import QtQuick.Controls 2.0 Item { id: root width: 200 height: 700 ListView { id: list clip: true spacing: 10 model: 100 width: 100 height: 500 highlightFollowsCurrentItem : false //highlightRangeMode: delegate: Rectangle { width: 100 height: 100 color: "green" opacity: ListView.isCurrentItem ? 1 : 0.5 Text { anchors.centerIn: parent text: index font.pixelSize: 20 } } } Button { anchors.top: list.bottom width: 100 height: 100 text: list.currentIndex onClicked: list.currentIndex = ++list.currentIndex % list.count } }
Preconditions:
Scroll the list so that the current item was before visible items.
Steps:
Click on button (change current index)
Observed result:
highlightRangeMode = ListView.ApplyRange: the Listview scrolls to the beginning
highlightRangeMode = ListView.StrictlyEnforceRange: unable to execute (the current item can't be before visible items.)
highlightRangeMode = ListView.NoHighlightRang: the Listview scrolls so that the current item becomes visible
If the current item is visible, or it is after visible items, then the ListView will not scrolled, when the current index changed (independently of highlightRangeMode).
Is it possible to make behavior independent of the position of the current item?