diff options
author | Shawn Rutledge <shawn.rutledge@qt.io> | 2018-08-31 13:42:22 +0200 |
---|---|---|
committer | Shawn Rutledge <shawn.rutledge@qt.io> | 2018-08-31 13:59:30 +0000 |
commit | 35caa44992c32bd51e55b7b039df8fad7c945bc6 (patch) | |
tree | ca8c860c4d1cc55f17e83c476cdba75a86ee963c /src/quick/handlers/qquickpointerhandler.cpp | |
parent | bdb18e33e8b8c7e62514849378107a47a3667431 (diff) |
Rename QQEventPoint::GrabState to GrabTransition
This enum represents a transient state transition, and only sometimes
corresponds to the current grab state of an event point. For example
after exclusive grab has been canceled, the current state is that
there is no exclusive grab: it doesn't make sense to remember that the
way it got there was by cancellation. There was an idea to add a
grabState property, but not all values would be eligible. An
EventPoint can be exclusively grabbed by one item or handler at a
time, and by multiple passive grabbers at the same time, so even a
Q_FLAG would not fully express all possible states. Besides, there is
already an exclusiveGrabber property, and we could add a
passiveGrabbers list property if we had a real need. So adding a
grabState property seems unlikely, and therefore is not a good enough
reason to keep this enum named as GrabState.
Change-Id: Ie37742b4bd431a7e51910d79a7223fba9a6bd848
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
Diffstat (limited to 'src/quick/handlers/qquickpointerhandler.cpp')
-rw-r--r-- | src/quick/handlers/qquickpointerhandler.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/quick/handlers/qquickpointerhandler.cpp b/src/quick/handlers/qquickpointerhandler.cpp index db58046e81..9b8281b519 100644 --- a/src/quick/handlers/qquickpointerhandler.cpp +++ b/src/quick/handlers/qquickpointerhandler.cpp @@ -116,7 +116,7 @@ void QQuickPointerHandler::setMargin(qreal pointDistanceThreshold) Notification that the grab has changed in some way which is relevant to this handler. The \a grabber (subject) will be the Input Handler whose state is changing, or null if the state change regards an Item. - The \a stateChange (verb) tells what happened. + The \a transition (verb) tells what happened. The \a point (object) is the point that was grabbed or ungrabbed. EventPoint has the sole responsibility to call this function. The Input Handler must react in whatever way is appropriate, and must @@ -125,13 +125,13 @@ void QQuickPointerHandler::setMargin(qreal pointDistanceThreshold) call its parent class's implementation in addition to (usually after) whatever custom behavior it implements. */ -void QQuickPointerHandler::onGrabChanged(QQuickPointerHandler *grabber, QQuickEventPoint::GrabState stateChange, QQuickEventPoint *point) +void QQuickPointerHandler::onGrabChanged(QQuickPointerHandler *grabber, QQuickEventPoint::GrabTransition transition, QQuickEventPoint *point) { - qCDebug(lcPointerHandlerGrab) << point << stateChange << grabber; + qCDebug(lcPointerHandlerGrab) << point << transition << grabber; Q_ASSERT(point); if (grabber == this) { bool wasCanceled = false; - switch (stateChange) { + switch (transition) { case QQuickEventPoint::GrabPassive: case QQuickEventPoint::GrabExclusive: break; @@ -156,7 +156,7 @@ void QQuickPointerHandler::onGrabChanged(QQuickPointerHandler *grabber, QQuickEv } if (wasCanceled) emit canceled(point); - emit grabChanged(stateChange, point); + emit grabChanged(transition, point); } } @@ -500,12 +500,12 @@ void QQuickPointerHandler::handlePointerEventImpl(QQuickPointerEvent *event) */ /*! - \qmlsignal QtQuick::PointerHandler::grabChanged(GrabState stateChange, EventPoint point) + \qmlsignal QtQuick::PointerHandler::grabChanged(GrabTransition transition, EventPoint point) This signal is emitted when the grab has changed in some way which is relevant to this handler. - The \a stateChange (verb) tells what happened. + The \a transition (verb) tells what happened. The \a point (object) is the point that was grabbed or ungrabbed. */ |