QML ListView items are inaccessible because auto-scrolling goes too far
-
Hi all.
We use a ListView for a file browser in our app, and I discovered that I couldn't get into a particular directory because it whizzes through the ListView pane without stopping. I can't find any setting to control the scroll distance, although it seems to me that this shouldn't be something we have to baby-sit anyway.
In this video, the list makes it impossible to access two directories:
...
Creative Cloud Files
data <--- whizzes past
Desktop <--- whizzes past
Documents
...I tried setting snapMode to SnapOneItem, but this breaks the mousewheel entirely (scrolling no longer works).
Are these known issues?
I dislike the auto-scrolling behavior anyway. It's fussy and time-consuming to sit there and wait for the list to settle before you can interact with it. I want the list to scroll one row per mousewheel click. Is there a way to opt for this?
Thanks!
-
Are your rows the same height as text?
You are right, normally ListView "just works" and requires no baby sitting. I suspect your delegates are maybe not reporting their height correctly?
I dislike the auto-scrolling behavior anyway. It's fussy and time-consuming to sit there and wait for the list to settle before you can interact with it.
What auto-scroll? You mean the animation of scrolling? You can adjust this by using Flickable (ListView's parent component) properties, see:
- https://doc.qt.io/qt-5/qml-qtquick-flickable.html#flickDeceleration-prop
- https://doc.qt.io/qt-5/qml-qtquick-flickable.html#maximumFlickVelocity-prop
I want the list to scroll one row per mousewheel click. Is there a way to opt for this?
-
Are your rows the same height as text?
You are right, normally ListView "just works" and requires no baby sitting. I suspect your delegates are maybe not reporting their height correctly?
I dislike the auto-scrolling behavior anyway. It's fussy and time-consuming to sit there and wait for the list to settle before you can interact with it.
What auto-scroll? You mean the animation of scrolling? You can adjust this by using Flickable (ListView's parent component) properties, see:
- https://doc.qt.io/qt-5/qml-qtquick-flickable.html#flickDeceleration-prop
- https://doc.qt.io/qt-5/qml-qtquick-flickable.html#maximumFlickVelocity-prop
I want the list to scroll one row per mousewheel click. Is there a way to opt for this?
@sierdzio Thanks for the reply.
ListView was auto-scrolling an entire page (actually, more than an entire page) at a time with a single click of the mousewheel. Cranking flickDeceleration up to 10000 suppressed this behavior sufficiently. Thanks.
It's unfortunate that the implementation interprets the mousewheel as "flicking," because using a very-high deceleration rate to make a ListView usable with a mouse hobbles it for touch.