diff options
Diffstat (limited to 'examples/widgets/touch')
-rw-r--r-- | examples/widgets/touch/fingerpaint/scribblearea.cpp | 6 | ||||
-rw-r--r-- | examples/widgets/touch/knobs/knob.cpp | 8 | ||||
-rw-r--r-- | examples/widgets/touch/pinchzoom/graphicsview.cpp | 8 |
3 files changed, 11 insertions, 11 deletions
diff --git a/examples/widgets/touch/fingerpaint/scribblearea.cpp b/examples/widgets/touch/fingerpaint/scribblearea.cpp index 7af565ff30..2e6e532afb 100644 --- a/examples/widgets/touch/fingerpaint/scribblearea.cpp +++ b/examples/widgets/touch/fingerpaint/scribblearea.cpp @@ -196,11 +196,11 @@ bool ScribbleArea::event(QEvent *event) case QEvent::TouchEnd: { const QTouchEvent *touch = static_cast<QTouchEvent *>(event); - const QList<QTouchEvent::TouchPoint> touchPoints = static_cast<QTouchEvent *>(event)->touchPoints(); + const auto touchPoints = static_cast<QTouchEvent *>(event)->points(); for (const QTouchEvent::TouchPoint &touchPoint : touchPoints) { switch (touchPoint.state()) { - case Qt::TouchPointStationary: - case Qt::TouchPointReleased: + case QEventPoint::Stationary: + case QEventPoint::Released: // don't do anything if this touch point hasn't moved or has been released continue; default: diff --git a/examples/widgets/touch/knobs/knob.cpp b/examples/widgets/touch/knobs/knob.cpp index 659ba82f45..eb64b56ceb 100644 --- a/examples/widgets/touch/knobs/knob.cpp +++ b/examples/widgets/touch/knobs/knob.cpp @@ -77,11 +77,11 @@ bool Knob::sceneEvent(QEvent *event) { QTouchEvent *touchEvent = static_cast<QTouchEvent *>(event); - if (touchEvent->touchPoints().count() == 2) { - const QTouchEvent::TouchPoint &touchPoint1 = touchEvent->touchPoints().first(); - const QTouchEvent::TouchPoint &touchPoint2 = touchEvent->touchPoints().last(); + if (touchEvent->points().count() == 2) { + const QEventPoint &touchPoint1 = touchEvent->points().first(); + const QEventPoint &touchPoint2 = touchEvent->points().last(); - QLineF line1(touchPoint1.lastScenePos(), touchPoint2.lastScenePos()); + QLineF line1(touchPoint1.sceneLastPosition(), touchPoint2.sceneLastPosition()); QLineF line2(touchPoint1.scenePosition(), touchPoint2.scenePosition()); setTransform(QTransform().rotate(line2.angleTo(line1)), true); diff --git a/examples/widgets/touch/pinchzoom/graphicsview.cpp b/examples/widgets/touch/pinchzoom/graphicsview.cpp index e1ce42f93f..5ad3f9152b 100644 --- a/examples/widgets/touch/pinchzoom/graphicsview.cpp +++ b/examples/widgets/touch/pinchzoom/graphicsview.cpp @@ -68,15 +68,15 @@ bool GraphicsView::viewportEvent(QEvent *event) case QEvent::TouchEnd: { QTouchEvent *touchEvent = static_cast<QTouchEvent *>(event); - QList<QTouchEvent::TouchPoint> touchPoints = touchEvent->touchPoints(); + const auto touchPoints = touchEvent->points(); if (touchPoints.count() == 2) { // determine scale factor - const QTouchEvent::TouchPoint &touchPoint0 = touchPoints.first(); - const QTouchEvent::TouchPoint &touchPoint1 = touchPoints.last(); + const QEventPoint &touchPoint0 = touchPoints.first(); + const QEventPoint &touchPoint1 = touchPoints.last(); qreal currentScaleFactor = QLineF(touchPoint0.position(), touchPoint1.position()).length() / QLineF(touchPoint0.pressPosition(), touchPoint1.pressPosition()).length(); - if (touchEvent->touchPointStates() & Qt::TouchPointReleased) { + if (touchEvent->touchPointStates() & QEventPoint::Released) { // if one of the fingers is released, remember the current scale // factor so that adding another finger later will continue zooming // by adding new scale factor to the existing remembered value. |