aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/handlers/qquickhoverhandler.cpp
diff options
context:
space:
mode:
authorRichard Moe Gustavsen <richard.gustavsen@qt.io>2022-09-13 13:35:42 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2022-09-16 14:27:22 +0000
commit84359266681941cf4625698ee818f61c85817e36 (patch)
tree1cc98c5a44ed0faeaac6f3d09ff6573bf3b045f8 /src/quick/handlers/qquickhoverhandler.cpp
parentb8955991ed5e5a390b1eef0adbbc072749924fb4 (diff)
DA: ignore disabled HoverHandlers when delivering hover events
According to the documentation for HoverHandler::enabled, a disabled hover handler will not accept any mouse events. It therefore follows naturally that a disabled HoverHandler should also not affect event propagation elsewhere. This patch will change the implementation, so that we don't deliver hover events to HoverHandlers that are disabled. This also means that disabled HoverHandlers will no longer block propagation to its siblings. [ChangeLog][QtQuick][HoverHandler] Disabled hover handlers will no longer receive hover events, or block siblings from being hovered. Fixes: QTBUG-106548 Change-Id: I7f2e459ba39f1e23cdb13bf94f8754e185dcd0c1 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> (cherry picked from commit 205e31df1674da5d9de78c4338d3221309086333) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'src/quick/handlers/qquickhoverhandler.cpp')
-rw-r--r--src/quick/handlers/qquickhoverhandler.cpp4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/quick/handlers/qquickhoverhandler.cpp b/src/quick/handlers/qquickhoverhandler.cpp
index 846164bdef..a558ddd95a 100644
--- a/src/quick/handlers/qquickhoverhandler.cpp
+++ b/src/quick/handlers/qquickhoverhandler.cpp
@@ -102,10 +102,8 @@ bool QQuickHoverHandler::event(QEvent *event)
void QQuickHoverHandler::componentComplete()
{
QQuickSinglePointHandler::componentComplete();
- if (auto par = parentItem()) {
- par->setAcceptHoverEvents(true);
+ if (auto par = parentItem())
QQuickItemPrivate::get(par)->setHasHoverInChild(true);
- }
}
bool QQuickHoverHandler::wantsPointerEvent(QPointerEvent *event)