summaryrefslogtreecommitdiffstats
path: root/tests/manual/gestures
diff options
context:
space:
mode:
authorShawn Rutledge <shawn.rutledge@qt.io>2020-07-07 08:19:12 +0200
committerShawn Rutledge <shawn.rutledge@qt.io>2020-12-01 20:20:11 +0100
commit2e0f7117b60781019fb97b3db73b731323b6609f (patch)
tree506162138db08878ff0a2cbbeec4dd0da55bdc4b /tests/manual/gestures
parent62dad9be9e172597c56a970202299563aa04918e (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')
-rw-r--r--tests/manual/gestures/graphicsview/gestures.cpp10
-rw-r--r--tests/manual/gestures/graphicsview/mousepangesturerecognizer.cpp2
2 files changed, 5 insertions, 7 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 {
diff --git a/tests/manual/gestures/graphicsview/mousepangesturerecognizer.cpp b/tests/manual/gestures/graphicsview/mousepangesturerecognizer.cpp
index 032fed933e..e70a9e4ef7 100644
--- a/tests/manual/gestures/graphicsview/mousepangesturerecognizer.cpp
+++ b/tests/manual/gestures/graphicsview/mousepangesturerecognizer.cpp
@@ -57,7 +57,7 @@ QGestureRecognizer::Result MousePanGestureRecognizer::recognize(QGesture *state,
case QEvent::MouseButtonPress:
case QEvent::MouseMove:
case QEvent::MouseButtonRelease:
- globalPos = static_cast<QMouseEvent *>(event)->globalPos();
+ globalPos = static_cast<QMouseEvent *>(event)->globalPosition().toPoint();
break;
default:
break;