Details
-
Task
-
Resolution: Unresolved
-
P2: Important
-
None
-
None
Description
Currently we have two ways of scrolling in Qt Quick (Controls); Flickable and ScrollView. The former scrolls by flicking, the latter by dragging on the scrollbars.
Currently you would have to use Flickable for apps targeting touch platforms, and ScrollView for desktop platforms. With this task I'm suggesting that we instead improve ScrollView so that it's also usable on both touch-, and desktop platforms, offering a single, styled, cross-platform API for:
- moving scrollbars (desktop/mouse platform)
- touchscreen flicking (touch platform)
- touchpad flicking (desktop/touchpad platform)
- mouse-wheeling (desktop/mouse platform
The changes needed:
- A small API addition to ScrollView that lets you specify if you want to use flicking, scrolling, or "auto". Auto (default), will use flicking + scroll indicators on touch platforms, and scrollbars on desktop platforms.
- Recommend/document that developers should almost always use ScrollView over Flickable.
The benefits:
- The same application source code can be used for both desktop and touch platforms
- The developer doesn't need to think about attaching scroll indicators or scrollbars to a Flickable manually. Doing so will anyway not work correctly for non-transient scrollbars, since then the contents should not go under the scrollbars. Attaching scrollbars to a flickable will always make them float on top, since you cannot push the contentItem to fit inside the scrollbars.
- The difference between Flickable and ScrollView is similar to the difference between TextInput and TextField - The former is a low-level primitive, unstyled, and not really meant to be used directly by application developers. The latter is more high-level, styled, and platform-aware.
Attachments
Issue Links
- depends on
-
QTBUG-129811 maOS Style ScrollBar does not align with native macOS behavior
- In Progress