diff options
author | Shawn Rutledge <shawn.rutledge@qt.io> | 2020-06-04 18:07:06 +0200 |
---|---|---|
committer | Shawn Rutledge <shawn.rutledge@qt.io> | 2020-06-08 19:11:51 +0200 |
commit | a061a646429c6e9d695458fc0ecb0021a30e12ee (patch) | |
tree | 7ba6fce7ee7c8975b0c50e31195bd02c5419fc15 /examples/widgets/painting/shared | |
parent | 24e52c10deedbaef833c0e2c3ee7bee03eacc4f5 (diff) |
Replace calls to deprecated QEvent accessor functions
Many of these were generated by clazy using the new qevent-accessors check.
Change-Id: Ie17af17f50fdc9f47d7859d267c14568cc350fd0
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Diffstat (limited to 'examples/widgets/painting/shared')
-rw-r--r-- | examples/widgets/painting/shared/hoverpoints.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/examples/widgets/painting/shared/hoverpoints.cpp b/examples/widgets/painting/shared/hoverpoints.cpp index f834f315f9..9fe947cedc 100644 --- a/examples/widgets/painting/shared/hoverpoints.cpp +++ b/examples/widgets/painting/shared/hoverpoints.cpp @@ -102,7 +102,7 @@ bool HoverPoints::eventFilter(QObject *object, QEvent *event) return true; QMouseEvent *me = (QMouseEvent *) event; - QPointF clickPos = me->pos(); + QPointF clickPos = me->position().toPoint(); int index = -1; for (int i=0; i<m_points.size(); ++i) { QPainterPath path; @@ -170,7 +170,7 @@ bool HoverPoints::eventFilter(QObject *object, QEvent *event) if (!m_fingerPointMapping.isEmpty()) return true; if (m_currentIndex >= 0) - movePoint(m_currentIndex, ((QMouseEvent *)event)->pos()); + movePoint(m_currentIndex, ((QMouseEvent *)event)->position().toPoint()); break; case QEvent::TouchBegin: case QEvent::TouchUpdate: @@ -197,7 +197,7 @@ bool HoverPoints::eventFilter(QObject *object, QEvent *event) if (activePoints.contains(i)) continue; - qreal d = QLineF(touchPoint.pos(), m_points.at(i)).length(); + qreal d = QLineF(touchPoint.position(), m_points.at(i)).length(); if ((distance < 0 && d < 12 * pointSize) || d < distance) { distance = d; activePoint = i; @@ -207,7 +207,7 @@ bool HoverPoints::eventFilter(QObject *object, QEvent *event) } if (activePoint != -1) { m_fingerPointMapping.insert(touchPoint.id(), activePoint); - movePoint(activePoint, touchPoint.pos()); + movePoint(activePoint, touchPoint.position()); } } break; @@ -215,7 +215,7 @@ bool HoverPoints::eventFilter(QObject *object, QEvent *event) { // move the point and release QHash<int,int>::iterator it = m_fingerPointMapping.find(id); - movePoint(it.value(), touchPoint.pos()); + movePoint(it.value(), touchPoint.position()); m_fingerPointMapping.erase(it); } break; @@ -224,7 +224,7 @@ bool HoverPoints::eventFilter(QObject *object, QEvent *event) // move the point const int pointIdx = m_fingerPointMapping.value(id, -1); if (pointIdx >= 0) // do we track this point? - movePoint(pointIdx, touchPoint.pos()); + movePoint(pointIdx, touchPoint.position()); } break; default: |