diff options
Diffstat (limited to 'examples/quick/customitems/maskedmousearea/maskedmousearea.cpp')
-rw-r--r-- | examples/quick/customitems/maskedmousearea/maskedmousearea.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/examples/quick/customitems/maskedmousearea/maskedmousearea.cpp b/examples/quick/customitems/maskedmousearea/maskedmousearea.cpp index 9a107e0143..55fce54ac0 100644 --- a/examples/quick/customitems/maskedmousearea/maskedmousearea.cpp +++ b/examples/quick/customitems/maskedmousearea/maskedmousearea.cpp @@ -115,7 +115,7 @@ bool MaskedMouseArea::contains(const QPointF &point) const void MaskedMouseArea::mousePressEvent(QMouseEvent *event) { setPressed(true); - m_pressPoint = event->pos(); + m_pressPoint = event->position().toPoint(); emit pressed(); } @@ -125,8 +125,8 @@ void MaskedMouseArea::mouseReleaseEvent(QMouseEvent *event) emit released(); const int threshold = qApp->styleHints()->startDragDistance(); - const bool isClick = (threshold >= qAbs(event->x() - m_pressPoint.x()) && - threshold >= qAbs(event->y() - m_pressPoint.y())); + const bool isClick = (threshold >= qAbs(event->position().toPoint().x() - m_pressPoint.x()) && + threshold >= qAbs(event->position().toPoint().y() - m_pressPoint.y())); if (isClick) emit clicked(); |