diff options
author | Richard Moe Gustavsen <richard.gustavsen@qt.io> | 2021-02-25 13:47:37 +0100 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2021-03-30 18:48:22 +0000 |
commit | 9ed9a14be80b377e6681db8076dce31316ded144 (patch) | |
tree | c861987ae854a64f06fc8e8a7fb1b6001040db14 /src/quick/handlers/qquickwheelhandler.cpp | |
parent | 43cd08cde3e9115753a6b3a817419f199c703405 (diff) |
QQuickSinglePointHandler: don't reset the point in hover handlers
A HoverHandler should not reset the reported position when it
receives a mouse release. As it stands, a HoverHandler, like all
the other SinglPointHandlers, will emit a position change of (0, 0)
when clicking on it.
This patch will factor the reset code into the virtual
handleEventPoint(). By doing so, the subclasses can choose to
call the base implementation to opt in for the "reset" logic.
This patch will let all the subclasses, except HoverHandler, do that.
Fixes: QTBUG-83980
Change-Id: Idc5720a2aad2b0b5714807965e0edc4e8325bfdc
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
(cherry picked from commit 79cde77f23358adbe57ab8ce08730d2de5bb1288)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'src/quick/handlers/qquickwheelhandler.cpp')
-rw-r--r-- | src/quick/handlers/qquickwheelhandler.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/quick/handlers/qquickwheelhandler.cpp b/src/quick/handlers/qquickwheelhandler.cpp index b598e43439..7045f10d8e 100644 --- a/src/quick/handlers/qquickwheelhandler.cpp +++ b/src/quick/handlers/qquickwheelhandler.cpp @@ -387,6 +387,8 @@ bool QQuickWheelHandler::wantsPointerEvent(QPointerEvent *event) void QQuickWheelHandler::handleEventPoint(QPointerEvent *ev, QEventPoint &point) { Q_D(QQuickWheelHandler); + QQuickSinglePointHandler::handleEventPoint(ev, point); + if (ev->type() != QEvent::Wheel) return; const QWheelEvent *event = static_cast<const QWheelEvent *>(ev); |