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

QGestureEvents for gesture received after app ignored gesture in GestureStarted state.

    XMLWordPrintable

Details

    • macOS

    Description

      The Qt Gestures Programming doc says "....in the Qt::GestureStarted state. The way you handle the gesture at this point influences whether you can interact with it later.... Ignoring the gesture will mean the gesture will never be offered to you again. ..."

      It seems that Qt's implementation doesn't correspond to the documentation: my app continues to receive QGestureEvents (having the gesture in the Qt::GestureUpdated state) after my app has ignored the gesture while it was in the GestureStarted state in a GestureEvent that I also ignored (I also tried to ignore the gesture but accept the containing GestureEvent.)

      Looking at the code in qgesturemanager.cpp, the last few lines of deliverEvents() seems to be where the code determines whether a gesture in the GestureStarted state has been accepted or ignored by the app. If the app ignores, the code does not remove the widget from m_gestureTargets, but I think it already is in m_gestureTargets (that's how the code directs the event for the started gesture to the target widget.) On subsequent low-level (say touch) events, I think the gesture manager continues to send gesture events (now updates) to the target widget. I could be wrong.

      I don't think this is critical since an app can workaround by simply continuing to ignore the gesture. Also, I'm testing my app with two hands, one hand dragging the mouse while the other hand pinches a trackpad (which I ignore.) Thats probably rare, the usual case is that two interactions (gestures) come from the same motion on one input device, the app accepts one and cancels the other.

      The small app testgesture.py in https://github.com/bootchk/qtGestureFramework.git demonstrates (prints events to the console. Make a gesture with middle mouse button down. Holding down Ctl key should ignore gesture and prevent gesture update events, but doesn't.)

      Attachments

        Issue Links

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

          Activity

            People

              sorvig Morten Sørvig
              bootchk lloyd konneker
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes