Skip to content

WheelHandler: Improve consistency with scrolling in Qt Widgets, add more properties

Noah Davis requested to merge work/ndavis/wheelhandler into master

Scrolling now behaves like Qt Widgets, even for touchpads.

When scrolling starts, a hidden item used to filter wheel events from children of the flickable is activated. It turns off 400ms after scrolling has stoppped.

Because of issues with the way Flickable handles wheel events created by touchpad gestures on Wayland, all wheel events created by that source are always accepted. Otherwise, the view sometimes snaps back to where it was when scrolling began.

horizontal and vertical scroll speed can now be customized via horizontalStepSize and verticalStepSize

Wheel events on scrollbars attached to the flickable are now handled.

filterMouseEvents can be used to handle mouse and touch input like a scrollview without having to use a scrollview.

keyNavigationEnabled can be used to enable scrolling via keyboard navigation, including arrow key navigaiton, PageUp, PageDown, Home, End and horizontal versions of the last 4 when Alt is held.

Page scrolling is now much smoother with a touchpad.

Alt can be used for horizontal scrolling on both X11 and Wayland.

There are now invokable functions for scrolling in a specific direction by a specific amount that return true if scrolling actually happened.

I've added autotests to help ensure that functionality doesn't regress and some manual tests which will allow you to test the changes locally. Currently, qqc2-desktop-style horizontal scrollbars are bugged, but that's completely unrelated to the changes in this MR.

The global filter has been removed and replaced with instance specific filters. This is necessary because each filter needs information specific to the instance filtering the events. There isn't really a usecase for allowing multiple Kirigami WheelHandlers anymore now that we can use Qt Quick WheelHandler.

Added Qt Widgets comparison tests.

Remove auto horizontal scroll, as requested by ngraham.

Workaround xcb using Alt to transpose deltas and not wayland by not transposing when Alt is held with xcb.

Edited by Noah Davis

Merge request reports

Loading