diff options
author | Shawn Rutledge <shawn.rutledge@qt.io> | 2020-07-07 08:19:12 +0200 |
---|---|---|
committer | Shawn Rutledge <shawn.rutledge@qt.io> | 2020-12-01 20:20:11 +0100 |
commit | 2e0f7117b60781019fb97b3db73b731323b6609f (patch) | |
tree | 506162138db08878ff0a2cbbeec4dd0da55bdc4b /tests/manual/gestures/graphicsview/gestures.cpp | |
parent | 62dad9be9e172597c56a970202299563aa04918e (diff) |
Fix deprecations in manual tests
QEventPoint instead of TouchPoint: we have source compatibility for that,
but we can use the new type to avoid the deprecation warnings.
Some position accessors have been renamed too.
Change-Id: I5bfe5bc853931127a883d2bd61fab122495fd427
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'tests/manual/gestures/graphicsview/gestures.cpp')
-rw-r--r-- | tests/manual/gestures/graphicsview/gestures.cpp | 10 |
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 { |