diff options
Diffstat (limited to 'src/quick/items/qquickmultipointtoucharea.cpp')
-rw-r--r-- | src/quick/items/qquickmultipointtoucharea.cpp | 28 |
1 files changed, 12 insertions, 16 deletions
diff --git a/src/quick/items/qquickmultipointtoucharea.cpp b/src/quick/items/qquickmultipointtoucharea.cpp index 9a371207ce..3a807d3c66 100644 --- a/src/quick/items/qquickmultipointtoucharea.cpp +++ b/src/quick/items/qquickmultipointtoucharea.cpp @@ -88,20 +88,18 @@ void QQuickTouchPoint::setPointId(int id) These properties hold the current position of the touch point. */ -void QQuickTouchPoint::setX(qreal x) +void QQuickTouchPoint::setPosition(QPointF p) { - if (_x == x) + bool xch = (_x != p.x()); + bool ych = (_y != p.y()); + if (!xch && !ych) return; - _x = x; - emit xChanged(); -} - -void QQuickTouchPoint::setY(qreal y) -{ - if (_y == y) - return; - _y = y; - emit yChanged(); + _x = p.x(); + _y = p.y(); + if (xch) + emit xChanged(); + if (ych) + emit yChanged(); } /*! @@ -798,8 +796,7 @@ void QQuickMultiPointTouchArea::updateTouchPoint(QQuickTouchPoint *dtp, const QT //TODO: if !qmlDefined, could bypass setters. // also, should only emit signals after all values have been set dtp->setUniqueId(p->uniqueId()); - dtp->setX(p->pos().x()); - dtp->setY(p->pos().y()); + dtp->setPosition(p->pos()); dtp->setEllipseDiameters(p->ellipseDiameters()); dtp->setPressure(p->pressure()); dtp->setRotation(p->rotation()); @@ -817,8 +814,7 @@ void QQuickMultiPointTouchArea::updateTouchPoint(QQuickTouchPoint *dtp, const QM { dtp->setPreviousX(dtp->x()); dtp->setPreviousY(dtp->y()); - dtp->setX(e->localPos().x()); - dtp->setY(e->localPos().y()); + dtp->setPosition(e->localPos()); if (e->type() == QEvent::MouseButtonPress) { dtp->setStartX(e->localPos().x()); dtp->setStartY(e->localPos().y()); |