diff options
author | Richard Moe Gustavsen <richard.gustavsen@qt.io> | 2022-03-14 12:22:50 +0100 |
---|---|---|
committer | Richard Moe Gustavsen <richard.gustavsen@qt.io> | 2022-04-05 14:09:30 +0000 |
commit | bc93b587e655d21ceac06c9ab03f6c919e8a4f46 (patch) | |
tree | 9df642be25d90604d5f79b997db5e670339c6d4c /src | |
parent | fe9d9b22f20ecfd119c4dcaf1d05f5b27906a49e (diff) |
QQuickControl: let Control reject hover events
From testing Qt 6.1, a Control should not accept hover
events, and as such, block hover events from propagating.
This patch will make sure that QQuickControl rejects hover
events, and thereby restore the behavior Qt had up till Qt 6.1.
Fixes: QTBUG-101394
Fixes: QTBUG-100543
Fixes: QTBUG-100149
Fixes: QTBUG-98940
Fixes: QTBUG-98850
Fixes: QTBUG-95398
Change-Id: I2df9d0f9999ce074cab0c64accad9172b411fb63
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
(cherry picked from commit 0c7b0a43064c8be452f4be74701f1dabce87f24c)
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src')
-rw-r--r-- | src/quicktemplates2/qquickcontrol.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/quicktemplates2/qquickcontrol.cpp b/src/quicktemplates2/qquickcontrol.cpp index 1286ce3907..51ba596af2 100644 --- a/src/quicktemplates2/qquickcontrol.cpp +++ b/src/quicktemplates2/qquickcontrol.cpp @@ -1957,21 +1957,20 @@ void QQuickControl::hoverEnterEvent(QHoverEvent *event) { Q_D(QQuickControl); setHovered(d->hoverEnabled); - event->setAccepted(d->hoverEnabled); + event->ignore(); } void QQuickControl::hoverMoveEvent(QHoverEvent *event) { Q_D(QQuickControl); setHovered(d->hoverEnabled && contains(event->position())); - event->setAccepted(d->hoverEnabled); + event->ignore(); } void QQuickControl::hoverLeaveEvent(QHoverEvent *event) { - Q_D(QQuickControl); setHovered(false); - event->setAccepted(d->hoverEnabled); + event->ignore(); } #endif |