Details
-
Bug
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
-
6.5.8, 6.8.2, 6.9.0 Beta2
-
Windows 10 22H2, MSVC 2022 x64
Description
Code
import QtQuick import QtQuick.Controls.Basic Window { id: root width: 640 height: 480 visible: true property int lastIndex: 4 Row { anchors.fill: parent spacing: 10 Column { Text { text: "ListView" } ListView { id: listView width: 100 height: 200 model: root.lastIndex + 1 currentIndex: root.lastIndex clip: true delegate: Label { required property int index width: ListView.view.width height: ListView.view.height text: index verticalAlignment: Qt.AlignVCenter } } Button { text: "Decrement" onClicked: listView.currentIndex-- } Button { text: "Slow Reset" onClicked: listView.currentIndex = root.lastIndex } Button { text: "Fast Reset 1" onClicked: { listView.currentIndex = root.lastIndex listView.positionViewAtIndex(root.lastIndex, ListView.Beginning) } } Button { text: "Fast Reset 2" onClicked: { listView.positionViewAtIndex(root.lastIndex, ListView.Beginning) listView.currentIndex = root.lastIndex } } } Column { Text { text: "Tumbler" } Tumbler { id: tumbler model: root.lastIndex + 1 currentIndex: root.lastIndex wrap: false visibleItemCount: 1 } Button { text: "Decrement" onClicked: tumbler.currentIndex-- } Button { text: "Slow Reset" onClicked: tumbler.currentIndex = root.lastIndex } Button { text: "Fast Reset 1" onClicked: { tumbler.currentIndex = root.lastIndex tumbler.positionViewAtIndex(root.lastIndex, Tumbler.Beginning) } } Button { text: "Fast Reset 2" onClicked: { tumbler.positionViewAtIndex(root.lastIndex, Tumbler.Beginning) tumbler.currentIndex = root.lastIndex } } } } }
Steps to reproduce
- Build and run the code above
- Follow the steps at QTBUG-134118 for the "ListView" column
- Follow the steps at QTBUG-134118 for the "Tumbler" column
Outcomes
- For ListView, "Fast Reset 1" quickly snaps to "4" (Expected)
- For Tumbler, "Fast Reset 1" slowly animates to "4" (Not Expected)
- For both ListView and Tumbler, "Fast Reset 2" suffer from the glitches described at QTBUG-134118
Request
Please make "Fast Reset 1" for Tumbler behave like ListView
Attachments
Issue Links
- relates to
-
QTBUG-134118 ListView: Calling `positionViewAtIndex(idx)` followed by `currentIndex=idx` causes animation glitches later
-
- Reported
-
- replaces
-
QTBUG-122597 Strange animation onCurrentIndexChanged of QML Tumbler
-
- Closed
-