Details
-
Bug
-
Resolution: Won't Do
-
P3: Somewhat important
-
None
-
5.3.0
-
OSX 10.9, Ubuntu 14.04, Qt5.3, PyQt5
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
- relates to
-
QTBUG-40047 Documentation: Improve the documentation of creating own gesture recognizers
- Closed