diff options
-rw-r--r-- | src/quick/handlers/qquickpointerhandler.cpp | 12 | ||||
-rw-r--r-- | src/quick/handlers/qquickpointerhandler_p.h | 2 | ||||
-rw-r--r-- | tests/auto/quick/pointerhandlers/qquicktaphandler/tst_qquicktaphandler.cpp | 4 |
3 files changed, 10 insertions, 8 deletions
diff --git a/src/quick/handlers/qquickpointerhandler.cpp b/src/quick/handlers/qquickpointerhandler.cpp index a0325dd0c6..4539aa221c 100644 --- a/src/quick/handlers/qquickpointerhandler.cpp +++ b/src/quick/handlers/qquickpointerhandler.cpp @@ -124,8 +124,7 @@ void QQuickPointerHandler::onGrabChanged(QQuickPointerHandler *grabber, QQuickEv } if (wasCanceled) emit canceled(point); - else - emit grabChanged(point); + emit grabChanged(stateChange, point); } } @@ -456,10 +455,13 @@ void QQuickPointerHandler::handlePointerEventImpl(QQuickPointerEvent *event) */ /*! - \qmlsignal QtQuick::PointerHandler::grabChanged(EventPoint point) + \qmlsignal QtQuick::PointerHandler::grabChanged(GrabState stateChange, EventPoint point) - This signal is emitted when this handler has acquired or relinquished a - passive or exclusive grab of the given \a 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 point (object) is the point that was grabbed or ungrabbed. */ /*! diff --git a/src/quick/handlers/qquickpointerhandler_p.h b/src/quick/handlers/qquickpointerhandler_p.h index 1327e6be4e..c7420bcec2 100644 --- a/src/quick/handlers/qquickpointerhandler_p.h +++ b/src/quick/handlers/qquickpointerhandler_p.h @@ -110,7 +110,7 @@ Q_SIGNALS: void enabledChanged(); void activeChanged(); void targetChanged(); - void grabChanged(QQuickEventPoint *point); + void grabChanged(QQuickEventPoint::GrabState stateChange, QQuickEventPoint *point); void grabPermissionChanged(); void canceled(QQuickEventPoint *point); diff --git a/tests/auto/quick/pointerhandlers/qquicktaphandler/tst_qquicktaphandler.cpp b/tests/auto/quick/pointerhandlers/qquicktaphandler/tst_qquicktaphandler.cpp index cf18b5eca1..6d2c1ab3f9 100644 --- a/tests/auto/quick/pointerhandlers/qquicktaphandler/tst_qquicktaphandler.cpp +++ b/tests/auto/quick/pointerhandlers/qquicktaphandler/tst_qquicktaphandler.cpp @@ -599,8 +599,8 @@ void tst_TapHandler::componentUserBehavioralOverride() QQuickTapHandler *userTapHandler = button->findChild<QQuickTapHandler*>("override"); QVERIFY(userTapHandler); QSignalSpy tappedSpy(button, SIGNAL(tapped())); - QSignalSpy innerGrabChangedSpy(innerTapHandler, SIGNAL(grabChanged(QQuickEventPoint *))); - QSignalSpy userGrabChangedSpy(userTapHandler, SIGNAL(grabChanged(QQuickEventPoint *))); + QSignalSpy innerGrabChangedSpy(innerTapHandler, SIGNAL(grabChanged(QQuickEventPoint::GrabState, QQuickEventPoint *))); + QSignalSpy userGrabChangedSpy(userTapHandler, SIGNAL(grabChanged(QQuickEventPoint::GrabState, QQuickEventPoint *))); QSignalSpy innerPressedChangedSpy(innerTapHandler, SIGNAL(pressedChanged())); QSignalSpy userPressedChangedSpy(userTapHandler, SIGNAL(pressedChanged())); |