summaryrefslogtreecommitdiffstats
path: root/tests/manual/gestures/graphicsview/gestures.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/manual/gestures/graphicsview/gestures.cpp')
-rw-r--r--tests/manual/gestures/graphicsview/gestures.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/tests/manual/gestures/graphicsview/gestures.cpp b/tests/manual/gestures/graphicsview/gestures.cpp
index 6e5b07bf18..26e6b1853b 100644
--- a/tests/manual/gestures/graphicsview/gestures.cpp
+++ b/tests/manual/gestures/graphicsview/gestures.cpp
@@ -54,17 +54,15 @@ QGestureRecognizer::Result ThreeFingerSlideGestureRecognizer::recognize(QGesture
case QEvent::TouchUpdate:
if (d->state() != Qt::NoGesture) {
QTouchEvent *ev = static_cast<QTouchEvent*>(event);
- if (ev->touchPoints().size() == 3) {
+ if (ev->points().size() == 3) {
d->gestureFired = true;
result = QGestureRecognizer::TriggerGesture;
} else {
result = QGestureRecognizer::MayBeGesture;
- for (int i = 0; i < ev->touchPoints().size(); ++i) {
- const QTouchEvent::TouchPoint &pt = ev->touchPoints().at(i);
- const int distance = (pt.pos().toPoint() - pt.startPos().toPoint()).manhattanLength();
- if (distance > 20) {
+ for (const QEventPoint &pt : ev->points()) {
+ const int distance = (pt.globalPosition().toPoint() - pt.globalPressPosition().toPoint()).manhattanLength();
+ if (distance > 20)
result = QGestureRecognizer::CancelGesture;
- }
}
}
} else {