summaryrefslogtreecommitdiffstats
path: root/examples/widgets/painting/deform/pathdeform.cpp
diff options
context:
space:
mode:
authorShawn Rutledge <shawn.rutledge@qt.io>2020-06-04 18:07:06 +0200
committerShawn Rutledge <shawn.rutledge@qt.io>2020-06-08 19:11:51 +0200
commita061a646429c6e9d695458fc0ecb0021a30e12ee (patch)
tree7ba6fce7ee7c8975b0c50e31195bd02c5419fc15 /examples/widgets/painting/deform/pathdeform.cpp
parent24e52c10deedbaef833c0e2c3ee7bee03eacc4f5 (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/deform/pathdeform.cpp')
-rw-r--r--examples/widgets/painting/deform/pathdeform.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/examples/widgets/painting/deform/pathdeform.cpp b/examples/widgets/painting/deform/pathdeform.cpp
index 961d5e5e99..9ddc6ea12b 100644
--- a/examples/widgets/painting/deform/pathdeform.cpp
+++ b/examples/widgets/painting/deform/pathdeform.cpp
@@ -490,10 +490,10 @@ void PathDeformRenderer::mousePressEvent(QMouseEvent *e)
m_repaintTimer.stop();
m_offset = QPointF();
- if (QLineF(m_pos, e->pos()).length() <= m_radius)
- m_offset = m_pos - e->pos();
+ if (QLineF(m_pos, e->position().toPoint()).length() <= m_radius)
+ m_offset = m_pos - e->position().toPoint();
- m_mousePress = e->pos();
+ m_mousePress = e->position().toPoint();
// If we're not running in small screen mode, always assume we're dragging
m_mouseDrag = !m_smallScreen;
@@ -514,18 +514,18 @@ void PathDeformRenderer::mouseReleaseEvent(QMouseEvent *e)
void PathDeformRenderer::mouseMoveEvent(QMouseEvent *e)
{
- if (!m_mouseDrag && (QLineF(m_mousePress, e->pos()).length() > 25.0) )
+ if (!m_mouseDrag && (QLineF(m_mousePress, e->position().toPoint()).length() > 25.0) )
m_mouseDrag = true;
if (m_mouseDrag) {
QRect rectBefore = circle_bounds(m_pos, m_radius, m_fontSize);
if (e->type() == QEvent::MouseMove) {
- QLineF line(m_pos, e->pos() + m_offset);
+ QLineF line(m_pos, e->position().toPoint() + m_offset);
line.setLength(line.length() * .1);
QPointF dir(line.dx(), line.dy());
m_direction = (m_direction + dir) / 2;
}
- m_pos = e->pos() + m_offset;
+ m_pos = e->position().toPoint() + m_offset;
#if QT_CONFIG(opengl)
if (usesOpenGL()) {
update();