Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-104617

ScrollView: improve cross-platform usage

    XMLWordPrintable

Details

    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 scrolling and flicking.

      The changes needed:

      1. 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.
      2. Recommend/document that developers should almost always use ScrollView over Flickable.

      The benefits:

      1. The same application source code can be used for both desktop and touch platforms
      2. 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. 
      3. 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

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              richard Richard Moe Gustavsen
              richard Richard Moe Gustavsen
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes