aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/handlers
diff options
context:
space:
mode:
authorShawn Rutledge <shawn.rutledge@qt.io>2019-05-08 14:56:24 +0200
committerShawn Rutledge <shawn.rutledge@qt.io>2019-05-09 09:18:51 +0000
commit17237efaefabe924599abe00e92d8b54032d7915 (patch)
tree3e389ccc408d490fd855a2b6a202aefd3ec827af /src/quick/handlers
parentd12cc4f6b58ecb5f44458002fe9b74d0c84f10ae (diff)
Document TapHandler.tapped and [single|double]Tapped eventPoint argument
Amends b8fd580cb3453b3850c36765c4b2537538d2f4f8 to add documentation. The eventPoint is important to get ephemeral state from the pointing device: which button was released (thus triggering the tap), which device it was, and where the release occurred. Users may expect to use the point property, but QQuickHandlerPoint::reset(QQuickEventPoint *) resets every property of the point at the same time, so the architecture currently does not allow for mixed state, i.e. having correct button state but still holding leftover position information. It may be surprising for users, but the changes to the point property are an atomic transaction that occurs before the signal. Task-number: QTBUG-61749 Task-number: QTBUG-64847 Change-Id: I33e0e232084beba8e10d8b02fa3bf85f36293358 Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
Diffstat (limited to 'src/quick/handlers')
-rw-r--r--src/quick/handlers/qquicktaphandler.cpp27
1 files changed, 21 insertions, 6 deletions
diff --git a/src/quick/handlers/qquicktaphandler.cpp b/src/quick/handlers/qquicktaphandler.cpp
index 41ac294df3..73c559c998 100644
--- a/src/quick/handlers/qquicktaphandler.cpp
+++ b/src/quick/handlers/qquicktaphandler.cpp
@@ -380,35 +380,50 @@ void QQuickTapHandler::updateTimeHeld()
*/
/*!
- \qmlsignal QtQuick::TapHandler::tapped
+ \qmlsignal QtQuick::TapHandler::tapped(EventPoint eventPoint)
This signal is emitted each time the \c parent Item is tapped.
That is, if you press and release a touchpoint or button within a time
period less than \l longPressThreshold, while any movement does not exceed
the drag threshold, then the \c tapped signal will be emitted at the time
- of release.
+ of release. The \c eventPoint signal parameter contains information
+ from the release event about the point that was tapped:
+
+ \snippet pointerHandlers/tapHandlerOnTapped.qml 0
+
+ \note At the time this signal is emitted, \l point has been reset
+ (all coordinates are \c 0).
*/
/*!
- \qmlsignal QtQuick::TapHandler::singleTapped
+ \qmlsignal QtQuick::TapHandler::singleTapped(EventPoint eventPoint)
\since 5.11
This signal is emitted when the \c parent Item is tapped once.
After an amount of time greater than QStyleHints::mouseDoubleClickInterval,
it can be tapped again; but if the time until the next tap is less,
- \l tapCount will increase.
+ \l tapCount will increase. The \c eventPoint signal parameter contains
+ information from the release event about the point that was tapped.
+
+ \note At the time this signal is emitted, \l point has been reset
+ (all coordinates are \c 0).
*/
/*!
- \qmlsignal QtQuick::TapHandler::doubleTapped
+ \qmlsignal QtQuick::TapHandler::doubleTapped(EventPoint eventPoint)
\since 5.11
This signal is emitted when the \c parent Item is tapped twice within a
short span of time (QStyleHints::mouseDoubleClickInterval) and distance
(QPlatformTheme::MouseDoubleClickDistance or
QPlatformTheme::TouchDoubleTapDistance). This signal always occurs after
- \l singleTapped, \l tapped, and \l tapCountChanged.
+ \l singleTapped, \l tapped, and \l tapCountChanged. The \c eventPoint
+ signal parameter contains information from the release event about the
+ point that was tapped.
+
+ \note At the time this signal is emitted, \l point has been reset
+ (all coordinates are \c 0).
*/
/*!