diff options
author | Shawn Rutledge <shawn.rutledge@qt.io> | 2018-02-27 16:12:24 +0100 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2021-08-06 15:25:19 +0000 |
commit | aea7c4bd69cd6b4ee9fc268522cdbabec302ebd1 (patch) | |
tree | 94bcbd1cac25199c5c701665b9db97ea20683827 /src/quick/handlers | |
parent | 1ab5f1c6c85b0cc3a60596b9abc5c83506fa4554 (diff) |
doc: Improve the Input Handlers index page
- Document the exclusive/passive grab concepts better
- Mention gesturePolicy's impact on grab behavior in the TapHandler docs too
- More links
- Add a couple of snippets illustrating simple use cases with handlers
- Don't bother mentioning Qt.labs.handlers anymore
Task-number: QTBUG-68110
Change-Id: I5e6f538c2bc8cafef679f535a5248b218b4a8068
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
(cherry picked from commit aade6857d12b2c9cd5552d25f4d084a5fcd25f7d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'src/quick/handlers')
-rw-r--r-- | src/quick/handlers/qquicktaphandler.cpp | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/quick/handlers/qquicktaphandler.cpp b/src/quick/handlers/qquicktaphandler.cpp index 0a7cc7e075..541ce156d9 100644 --- a/src/quick/handlers/qquicktaphandler.cpp +++ b/src/quick/handlers/qquicktaphandler.cpp @@ -214,6 +214,8 @@ void QQuickTapHandler::timerEvent(QTimerEvent *event) If the spatial constraint is violated, \l pressed transitions immediately from true to false, regardless of the time held. + The \c gesturePolicy also affects grab behavior as described below. + \value TapHandler.DragThreshold (the default value) The event point must not move significantly. If the mouse, finger or stylus moves past the system-wide drag @@ -222,11 +224,13 @@ void QQuickTapHandler::timerEvent(QTimerEvent *event) can be useful whenever TapHandler needs to cooperate with other input handlers (for example \l DragHandler) or event-handling Items (for example QtQuick Controls), because in this case TapHandler - will not take the exclusive grab, but merely a passive grab. + will not take the exclusive grab, but merely a + \l {QPointerEvent::addPassiveGrabber()}{passive grab}. \value TapHandler.WithinBounds If the event point leaves the bounds of the \c parent Item, the tap - gesture is canceled. The TapHandler will take the exclusive grab on + gesture is canceled. The TapHandler will take the + \l {QPointerEvent::setExclusiveGrabber}{exclusive grab} on press, but will release the grab as soon as the boundary constraint is no longer satisfied. @@ -237,8 +241,9 @@ void QQuickTapHandler::timerEvent(QTimerEvent *event) typical behavior for button widgets: you can cancel a click by dragging outside the button, and you can also change your mind by dragging back inside the button before release. Note that it's - necessary for TapHandler take the exclusive grab on press and retain - it until release in order to detect this gesture. + necessary for TapHandler to take the + \l {QPointerEvent::setExclusiveGrabber}{exclusive grab} on press + and retain it until release in order to detect this gesture. */ void QQuickTapHandler::setGesturePolicy(QQuickTapHandler::GesturePolicy gesturePolicy) { |