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

QScroller does not work with touch gesture if no other gesture handler exists.

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P4: Low
    • None
    • 5.6.1
    • None
    • Windows 10, MSVC2015-64bit

    Description

      QScroller does not work with touch gesture because the TouchBegin recognizer of QFlickGestureRecognizer does not return QGestureRecognizer::ConsumeEventHint.

      In Qt's event processing, TouchUpdate/TouchEnd events are notified only if TouchBegin event handler returned true.

      In QGestureRecognizer, TouchBegin event handler returns true if any recognizer's return value is flagged with CosumeEventHint.

      QScroller uses QFlickGestureReocgnizer internally, and QFlickGestureRecognizer's recognizer returns MayBeGesture without ConsumeEventHint at TouchBegin.

      Therefore, QScroller does not work with touch gesture standalone.
      I believe that QFlickGestureRecognizer's recognizer should return with QGestureRecognizer::ConsumeEventHint at TouchBegin.

      Userside workaround is as follows:
      If other GestureRecognizers are installed into GestureMangager and at least one of them returned ConsumeEventHint at TouchBegin, TouchUpdate/TouchEnd events will be notified to QFlickGestureRecognizer.
      I created dummy gestureRecognizer.

      > class dummyRecognizer : public QGestureRecognizer
      > {
      > public:
      > QGesture *create(QObject *target)

      {return new QGesture; }

      > Result recognize(QGesture *gesture, QObject *watched, QEvent *event)
      > {
      > if (event->type() == QEvent::TouchBegin)

      { > return Ignore | ConsumeEventHint; > }

      > return Ignore;
      > }
      > void reset(QGesture *state) {}
      > };

      QScroller would work well with this recognizer.

      Attachments

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

        Activity

          People

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            taka2 Masamichi TAKATSU
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes