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

Add an *Handler way to detect swipe gestures in QtQuick

    XMLWordPrintable

Details

    • Suggestion
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • None
    • None

    Description

      In QML, we have SwipeView and SwipeDelegate, which can handle common use cases for swiping.

      However, there are instances where a more fine grained control is desired. Consider

      A) an ebook reader, where swiping left and right should turn a page (and where turning a page can involve anything from an immediate transition to a complex shader based page turn animation)
      B) a map viewer, where a swipe should move the view port (most likely depending on the swipe veloicity)
      C) Any more advanced gesture navigation than possible with SwipeView

      This can actually implemented with DragHandler, by (ab)using onActiveChanged and checking whether centroid.velocity and translation are over certain thresholds. However, that's rather imperative, and IMHO not obvious.

      It would be nicer if there were a
      signal swipe(double velocity, Direction direction)
      on DragHandler or maybe a dedicated SwipeHandler. It would probably make sense to have properties to control minimum thresholds for swipes (as opposed to simple drags), and to only trigger the signal for certain directions; though we could probably set some (platform specific?) defaults.

      Attachments

        Issue Links

          For Gerrit Dashboard: QTBUG-92086
          # Subject Branch Project Status CR V

          Activity

            People

              qt.team.quick.subscriptions Qt Quick and Widgets Team
              fabiankosmale Fabian Kosmale
              Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There is 1 open Gerrit change