diff options
author | Shawn Rutledge <shawn.rutledge@qt.io> | 2018-11-07 17:48:27 +0100 |
---|---|---|
committer | Shawn Rutledge <shawn.rutledge@qt.io> | 2018-12-13 21:38:51 +0000 |
commit | 12f89fb8dda86c61277e3814912013873b1657e6 (patch) | |
tree | 0e68ede778bd21bfa1e269c778014084d9387087 /src/quick/handlers | |
parent | 358a72b6ecd0fef69edf5355f299af10225a6c8b (diff) |
TapHandler: clean up when wantsEventPoint returns false
We already emitted grabCanceled() to inform QML callbacks, but we didn't
call reset(). It seems more proper to do everything that would normally
be done when grab is canceled. TapHandler should not give up its passive
grab yet though, because that prevents delivery to any parent Flickable
that might be filtering events. A parent Flickable should be able to
start flicking after the drag threshold is exceeded (it happens to be
exactly when TapHandler gives up).
Fixes: QTBUG-71466
Fixes: QTBUG-71970
Change-Id: Ibba1b0de92cfd88547eeb44edb095d019de76a94
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Diffstat (limited to 'src/quick/handlers')
-rw-r--r-- | src/quick/handlers/qquicksinglepointhandler_p.h | 1 | ||||
-rw-r--r-- | src/quick/handlers/qquicktaphandler.cpp | 6 |
2 files changed, 5 insertions, 2 deletions
diff --git a/src/quick/handlers/qquicksinglepointhandler_p.h b/src/quick/handlers/qquicksinglepointhandler_p.h index b9e5b12224..7bf8eff999 100644 --- a/src/quick/handlers/qquicksinglepointhandler_p.h +++ b/src/quick/handlers/qquicksinglepointhandler_p.h @@ -82,7 +82,6 @@ protected: void setPointId(int id); -private: void reset(); private: diff --git a/src/quick/handlers/qquicktaphandler.cpp b/src/quick/handlers/qquicktaphandler.cpp index e97722d6b7..bae76ddd94 100644 --- a/src/quick/handlers/qquicktaphandler.cpp +++ b/src/quick/handlers/qquicktaphandler.cpp @@ -308,8 +308,12 @@ void QQuickTapHandler::setPressed(bool press, bool cancel, QQuickEventPoint *poi // on release, ungrab after emitting changed signals setExclusiveGrab(point, press); } - if (cancel) + if (cancel) { emit canceled(point); + setExclusiveGrab(point, false); + reset(); + emit pointChanged(); + } } } |