diff options
author | Shawn Rutledge <shawn.rutledge@qt.io> | 2018-08-21 17:52:41 +0200 |
---|---|---|
committer | Shawn Rutledge <shawn.rutledge@qt.io> | 2018-08-22 11:51:01 +0000 |
commit | d83cb16d3cecad7ec2e9b45416620b87b52f2885 (patch) | |
tree | f0135fbd96a9514f7faac2b4b4f038bd35cd69a5 /src/quick/handlers | |
parent | 8bda9227a227dafac93c574bdf1071277b7b6f90 (diff) |
Doc: clarify the type and meaning of QQuickMultiPointHandler::centroid
Amends 52d35526f256bf4c8155f5e660a214ab8a2efbdf : it's now a QQuickHandlerPoint
rather than QPointF, and is inherited from MultiPointHandler to DragHandler
and PinchHandler. So the docs can be inherited too, but in PinchHandler
it seems more appropriate to keep the overridden docs which explain that
transformation around the centroid depends on pinchOrigin.
Task-number: QTBUG-70074
Change-Id: I8875b38439fe80c311a685ab9e3dedc9357415e8
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'src/quick/handlers')
-rw-r--r-- | src/quick/handlers/qquickdraghandler.cpp | 4 | ||||
-rw-r--r-- | src/quick/handlers/qquickmultipointhandler.cpp | 9 | ||||
-rw-r--r-- | src/quick/handlers/qquickpinchhandler.cpp | 2 |
3 files changed, 13 insertions, 2 deletions
diff --git a/src/quick/handlers/qquickdraghandler.cpp b/src/quick/handlers/qquickdraghandler.cpp index d9f0e477d1..ffdaa909dd 100644 --- a/src/quick/handlers/qquickdraghandler.cpp +++ b/src/quick/handlers/qquickdraghandler.cpp @@ -81,7 +81,9 @@ Q_LOGGING_CATEGORY(lcDragHandler, "qt.quick.handler.drag") a (default) single-finger DragHandler and a PinchHandler on the same Item, and thus can be used to adjust some other feature independently of the usual pinch behavior: for example adjust a tilt transformation, or adjust - some other numeric value. + some other numeric value, if the \c target is set to null. But if the + \l target is an Item, \l centroid is the point at which the drag begins and + to which the \c target will be moved (subject to constraints). At this time, drag-and-drop is not yet supported. diff --git a/src/quick/handlers/qquickmultipointhandler.cpp b/src/quick/handlers/qquickmultipointhandler.cpp index 5606162f15..cb3becaa2d 100644 --- a/src/quick/handlers/qquickmultipointhandler.cpp +++ b/src/quick/handlers/qquickmultipointhandler.cpp @@ -329,4 +329,13 @@ void QQuickMultiPointHandler::moveTarget(QPointF pos) m_centroid.m_position = target()->mapFromScene(m_centroid.m_scenePosition); } +/*! + \readonly + \qmlproperty QQuickHandlerPoint QtQuick::MultiPointHandler::centroid + + A point exactly in the middle of the currently-pressed touch points. + If only one point is pressed, it's the same as that point. + A handler that has a \l target will normally transform it relative to this point. +*/ + QT_END_NAMESPACE diff --git a/src/quick/handlers/qquickpinchhandler.cpp b/src/quick/handlers/qquickpinchhandler.cpp index 58cd91476d..24f9885534 100644 --- a/src/quick/handlers/qquickpinchhandler.cpp +++ b/src/quick/handlers/qquickpinchhandler.cpp @@ -520,7 +520,7 @@ void QQuickPinchHandler::handlePointerEventImpl(QQuickPointerEvent *event) /*! \readonly - \qmlproperty QPointF QtQuick::PinchHandler::centroid + \qmlproperty QQuickHandlerPoint QtQuick::PinchHandler::centroid A point exactly in the middle of the currently-pressed touch points. If \l pinchOrigin is set to \c PinchCenter, the \l target will be rotated |