diff options
author | Denis Dzyubenko <denis.dzyubenko@nokia.com> | 2009-06-03 09:56:12 (GMT) |
---|---|---|
committer | Denis Dzyubenko <denis.dzyubenko@nokia.com> | 2009-06-03 17:29:31 (GMT) |
commit | 928830fa0626499b5299386e2095c9fffbf69c8b (patch) | |
tree | 0553af9d64837f4b8a84a477670416f4cc98a7f7 /tests/auto/gestures/tst_gestures.cpp | |
parent | 0cca7705c01d262c1bb008f969a9705786e1c80e (diff) | |
download | Qt-928830fa0626499b5299386e2095c9fffbf69c8b.zip Qt-928830fa0626499b5299386e2095c9fffbf69c8b.tar.gz Qt-928830fa0626499b5299386e2095c9fffbf69c8b.tar.bz2 |
Added pan gesture to the gesture autotest
Diffstat (limited to 'tests/auto/gestures/tst_gestures.cpp')
-rw-r--r-- | tests/auto/gestures/tst_gestures.cpp | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/tests/auto/gestures/tst_gestures.cpp b/tests/auto/gestures/tst_gestures.cpp index 9639fb0..a649004 100644 --- a/tests/auto/gestures/tst_gestures.cpp +++ b/tests/auto/gestures/tst_gestures.cpp @@ -156,7 +156,8 @@ class GestureWidget : public QWidget static int numberOfWidgets; public: - enum Type { DoNotGrabGestures, GrabAllGestures, GrabSingleshot, GrabPinch, GrabSecondFinger }; + enum Type { DoNotGrabGestures, GrabAllGestures, GrabSingleshot, + GrabPinch, GrabSecondFinger, GrabPan }; static const int LeftMargin = 10; static const int TopMargin = 20; @@ -179,6 +180,7 @@ public: singleshotGestureId = -1; pinchGestureId = -1; secondFingerGestureId = -1; + panGestureId = -1; if (type == GrabAllGestures || type == GrabSingleshot) { singleshotGestureId = grabGesture(SingleshotGestureRecognizer::Name); } @@ -188,6 +190,9 @@ public: if (type == GrabAllGestures || type == GrabSecondFinger) { secondFingerGestureId = grabGesture(SecondFingerGestureRecognizer::Name); } + if (type == GrabAllGestures || type == GrabPan) { + panGestureId = grabGesture(PanGestureRecognizer::Name); + } reset(); } ~GestureWidget() @@ -208,6 +213,10 @@ public: { secondFingerGestureId = grabGesture(SecondFingerGestureRecognizer::Name); } + void grabPanGesture() + { + panGestureId = grabGesture(PanGestureRecognizer::Name); + } void ungrabGestures() { releaseGesture(singleshotGestureId); @@ -216,15 +225,19 @@ public: pinchGestureId = -1; releaseGesture(secondFingerGestureId); secondFingerGestureId = -1; + releaseGesture(panGestureId); + panGestureId = -1; } int singleshotGestureId; int pinchGestureId; int secondFingerGestureId; + int panGestureId; bool shouldAcceptSingleshotGesture; bool shouldAcceptPinchGesture; bool shouldAcceptSecondFingerGesture; + bool shouldAcceptPanGesture; GestureState gesture; @@ -233,6 +246,7 @@ public: shouldAcceptSingleshotGesture = true; shouldAcceptPinchGesture = true; shouldAcceptSecondFingerGesture = true; + shouldAcceptPanGesture = true; gesture.reset(); } protected: |