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

Add an *Handler way to detect swipe gestures in QtQuick

XMLWordPrintable

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

      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.

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

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

              Created:
              Updated:

                There is 1 open Gerrit change