diff options
author | Shawn Rutledge <shawn.rutledge@qt.io> | 2017-09-22 14:23:53 +0200 |
---|---|---|
committer | Shawn Rutledge <shawn.rutledge@qt.io> | 2017-09-29 05:16:33 +0000 |
commit | cff0864fa54a8d38f5fba90e6fc99a8c3598a498 (patch) | |
tree | 8c28d6fabd7c245d47a1658f4058c0bcae51445e /src/quick/handlers/qquickdraghandler.cpp | |
parent | 930aea8b9ca59a24838cf7f279653e3b2ee40cee (diff) |
change the type of DragHandler::translation to QVector2D; document it
For consistency we use QVector2D to represent relative movements in all
Pointer Handlers.
Change-Id: I23dc20c360b482a995d232e8a6d7e87d9bd8f600
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 | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/quick/handlers/qquickdraghandler.cpp b/src/quick/handlers/qquickdraghandler.cpp index 840459ba3e..5e7b6a4962 100644 --- a/src/quick/handlers/qquickdraghandler.cpp +++ b/src/quick/handlers/qquickdraghandler.cpp @@ -103,7 +103,7 @@ void QQuickDragHandler::handleEventPoint(QQuickEventPoint *point) if (!m_yAxis.enabled()) delta.setY(0); if (active()) { - setTranslation(delta); + setTranslation(QVector2D(delta)); if (target() && target()->parentItem()) { QPointF pos = target()->parentItem()->mapFromScene(m_targetStartPos + delta); enforceAxisConstraints(&pos); @@ -164,7 +164,7 @@ void QQuickDragHandler::initializeTargetStartPos(QQuickEventPoint *point) } } -void QQuickDragHandler::setTranslation(const QPointF &trans) +void QQuickDragHandler::setTranslation(const QVector2D &trans) { if (trans == m_translation) // fuzzy compare? return; @@ -207,4 +207,11 @@ void QQuickDragAxis::setEnabled(bool enabled) emit enabledChanged(); } +/*! + \readonly + \qmlproperty QVector2D QtQuick::DragHandler::translation + + The translation since the gesture began. +*/ + QT_END_NAMESPACE |