diff options
author | Shawn Rutledge <shawn.rutledge@qt.io> | 2021-09-07 16:54:44 +0200 |
---|---|---|
committer | Shawn Rutledge <shawn.rutledge@qt.io> | 2021-09-08 15:26:03 +0200 |
commit | 5864644ac8bc3c561696ffef5d033b1cab7d950f (patch) | |
tree | 7321b90368a93bde1921550b54166bed8f3374ec /tests/auto/quick/pointerhandlers | |
parent | deccfa4636400cee32efb1ba89eda1c88921ee3a (diff) |
Add button argument to the TapHandler.[single|double|]tapped signals
It would be better to emit the whole pointer event (by pointer because
it's non-copyable, or make it copyable and emit by value), but we can't.
So we just add the button being tapped; more information is available
from the eventpoint argument and TapHandler's point property.
To avoid name clashes with anything that's already called "button" in
anyone's QML (which is quite likely, actually), the new signal argument
is unnamed, so that users will be required to write a function signature
that gives it a name rather than relying on context injection.
[ChangeLog][QtQuick][Event Handlers] TapHandler's tapped(), singleTapped()
and doubleTapped() signals now have two arguments: the QEventPoint instance,
and the button being tapped. If you need it, you should write an explicit
function for the signal handler: onTapped: function(point, button) { ... }
or onDoubleTapped: (point, button)=> ...
Fixes: QTBUG-91350
Task-number: QTBUG-64847
Pick-to: 6.2 6.2.0
Change-Id: I6d25300cbfceb56f27452eac4b29b66bd1b2a41a
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'tests/auto/quick/pointerhandlers')
-rw-r--r-- | tests/auto/quick/pointerhandlers/qquicktaphandler/tst_qquicktaphandler.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/auto/quick/pointerhandlers/qquicktaphandler/tst_qquicktaphandler.cpp b/tests/auto/quick/pointerhandlers/qquicktaphandler/tst_qquicktaphandler.cpp index 9b1101eb3a..67583fae30 100644 --- a/tests/auto/quick/pointerhandlers/qquicktaphandler/tst_qquicktaphandler.cpp +++ b/tests/auto/quick/pointerhandlers/qquicktaphandler/tst_qquicktaphandler.cpp @@ -739,8 +739,8 @@ void tst_TapHandler::rightLongPressIgnoreWheel() QQuickTapHandler *tap = window->rootObject()->findChild<QQuickTapHandler*>(); QVERIFY(tap); - QSignalSpy tappedSpy(tap, SIGNAL(tapped(QEventPoint *))); - QSignalSpy longPressedSpy(tap, SIGNAL(longPressed())); + QSignalSpy tappedSpy(tap, &QQuickTapHandler::tapped); + QSignalSpy longPressedSpy(tap, &QQuickTapHandler::longPressed); QPoint p1(100, 100); // Mouse wheel with ScrollBegin phase (because as soon as two fingers are touching |