diff options
author | Shawn Rutledge <shawn.rutledge@qt.io> | 2017-04-24 12:53:58 +0200 |
---|---|---|
committer | Shawn Rutledge <shawn.rutledge@qt.io> | 2017-04-28 13:25:49 +0000 |
commit | 93563959cd9e64087599a829fc7d6afe22d3b487 (patch) | |
tree | 996f0413e727eec47695a8f65205440ca5f6e971 /src/quick/handlers/qquickdraghandler.cpp | |
parent | 8082698fff3ee87d0dfc75cdba0ae21ec523a3fe (diff) |
Add and use QQuickPointerSingleHandler::moveTarget()
Until now, DragHandler::pos() was not staying constant during a drag,
because we update m_pos from the EventPoint, then move the Item.
scenePos() also returns mapToScene(m_pos). If the Item is being dragged
to follow the finger or the mouse cursor exactly, unconstrained, then
pos() should always be the same as the parent-relative position where
the press occurred.
Change-Id: Ia02738c0cf458e039cf90371f9c8a7becb75a035
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
Diffstat (limited to 'src/quick/handlers/qquickdraghandler.cpp')
-rw-r--r-- | src/quick/handlers/qquickdraghandler.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/quick/handlers/qquickdraghandler.cpp b/src/quick/handlers/qquickdraghandler.cpp index b4006ab5c7..27edffd65a 100644 --- a/src/quick/handlers/qquickdraghandler.cpp +++ b/src/quick/handlers/qquickdraghandler.cpp @@ -107,7 +107,7 @@ void QQuickDragHandler::handleEventPoint(QQuickEventPoint *point) if (target() && target()->parentItem()) { QPointF pos = target()->parentItem()->mapFromScene(m_targetStartPos + delta); enforceAxisConstraints(&pos); - target()->setPosition(pos); + moveTarget(pos, point); } } else if (!point->exclusiveGrabber() && ((m_xAxis.enabled() && QQuickWindowPrivate::dragOverThreshold(delta.x(), Qt::XAxis, point)) || |