summaryrefslogtreecommitdiffstats
path: root/tests/auto/gestures/tst_gestures.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/gestures/tst_gestures.cpp')
-rw-r--r--tests/auto/gestures/tst_gestures.cpp16
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: