Swipe Gesture
-
I looked into the source code (qstandardgestures.cpp) and it seems that swipe uses 3 touch points, while on the docs it is showing an image with only one touch point. They don't even mention the three points in the docs, what a mess.
-
and now it works with 3 touch-points?
-
No, I'm only receiving pan, pinch and tap events, but not the Swipe. I tried with 3 fingers, with 4 fingers, slow, fast, no way to receive the gesture.
-
If you look at the docs of 5.0/4.8/4.7 I put a doc note at the end a year back with the same information that you listed above.
The same is for QPanGesture that accepts 2 touch points. For our development we are using a custom class that subclasses QGestureRecognizer and handles both swipe and pan gesture with single touch.
Tested on Windows and works very well.
I'll add the doc note to 5.1 as well and may be we need to address this in the mailing list .
For reference you can "check this":http://developer.nokia.com/Community/Wiki/Custom_Swipe_Gestures_in_Qt
-
Hello Sam, thanks for the information, I was going to start to implement the recognizer by myself and the referenced code will help a lot. Thanks again !
-
I'll change the mouse events to touch points and then accept only Swipe, which is the only gesture that I'll need right now. Thanks !
-
Sam, have you also faced an issue that even using grab the object doesn't receive the gesture ? I'm triggering the gesture but even after calling grabGesture() it doesn't arrive.
-
Are you using setAttribute(Qt::WA_AcceptTouchEvents); attribute for your widget anywhere ?
bq. Allows touch events (see QTouchEvent) to be sent to the widget. Must be set on all widgets that can handle touch events. Without this attribute set, events from a touch device will be sent as mouse events.
-
Yes, I'm using the WA_AcceptTouchEvents. I'll check it.
-
I'm definitively using WA_AcceptTouchEvents and also calling setAcceptTouchEvents(). The order of results being generated are: MayBeGesture, TriggerGesture and FinishGesture, but the gesture never arrive to the object. Do you know who is responsible by changing the QSwipeGesture::state() ? I'm always receiving Qt::NoGesture on the state too.