diff options
author | Volker Hilsheimer <volker.hilsheimer@qt.io> | 2020-09-17 12:06:52 +0200 |
---|---|---|
committer | Volker Hilsheimer <volker.hilsheimer@qt.io> | 2020-09-23 19:50:26 +0200 |
commit | 9c5698a8fcf9b890d8ed23b8e6cbab2971c8dc87 (patch) | |
tree | f32317cd546af26c1bc0439d99cf98c34ce99849 /src/widgets/util/qflickgesture.cpp | |
parent | 850d850c5af8ff77a4b9d53457ec6b1ba6c20cb3 (diff) |
Fix compiler warnings from deprecated QTouchEvent::touchPoints
Replace with QPointerEvent::points().
As a drive-by, turn QEventPoint copies into const references where possible.
Change-Id: Ia5e0645493984fe9177dd3ca16afdb4d56e384ee
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Diffstat (limited to 'src/widgets/util/qflickgesture.cpp')
-rw-r--r-- | src/widgets/util/qflickgesture.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/widgets/util/qflickgesture.cpp b/src/widgets/util/qflickgesture.cpp index 3b4af0fe8f..d23dfda83e 100644 --- a/src/widgets/util/qflickgesture.cpp +++ b/src/widgets/util/qflickgesture.cpp @@ -464,8 +464,8 @@ QGestureRecognizer::Result QFlickGestureRecognizer::recognize(QGesture *state, if (button == Qt::NoButton) { te = static_cast<const QTouchEvent *>(event); keyboardModifiers = te->modifiers(); - if (!te->touchPoints().isEmpty()) - globalPos = te->touchPoints().at(0).globalPosition().toPoint(); + if (!te->points().isEmpty()) + globalPos = te->points().at(0).globalPosition().toPoint(); } break; @@ -555,17 +555,17 @@ QGestureRecognizer::Result QFlickGestureRecognizer::recognize(QGesture *state, inputType = QScroller::InputMove; if (te->pointingDevice()->type() == QInputDevice::DeviceType::TouchPad) { - if (te->touchPoints().count() != 2) // 2 fingers on pad + if (te->points().count() != 2) // 2 fingers on pad return Ignore; - point = te->touchPoints().at(0).scenePressPosition() + - ((te->touchPoints().at(0).scenePosition() - te->touchPoints().at(0).scenePressPosition()) + - (te->touchPoints().at(1).scenePosition() - te->touchPoints().at(1).scenePressPosition())) / 2; + point = te->points().at(0).scenePressPosition() + + ((te->points().at(0).scenePosition() - te->points().at(0).scenePressPosition()) + + (te->points().at(1).scenePosition() - te->points().at(1).scenePressPosition())) / 2; } else { // TouchScreen - if (te->touchPoints().count() != 1) // 1 finger on screen + if (te->points().count() != 1) // 1 finger on screen return Ignore; - point = te->touchPoints().at(0).scenePosition(); + point = te->points().at(0).scenePosition(); } break; |