aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Moe Gustavsen <richard.gustavsen@qt.io>2022-10-27 15:54:39 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2022-11-01 17:47:47 +0000
commit46e4039bb2c2dd09c6f027a174a45d887b81320b (patch)
treeb259bf640899317bf8fa0d426aa138e1cc9b0749
parent2b0b1549f072d0b693f2ad97a55e480efb8db86c (diff)
DA: don't ignore subtreeHoverEnabled
The current hover delivery logic in the DA was currently only taking subtreeHoverEnabled into account for disabled items. This meant that subtreeHoverEnabled was in practice undermined by the DA, and resulted in far too many items in the scene being visited. Moreover, according to tst_HoverHandler::hoverHandlerOnDisabledItem(), and QTBUG-30801, we should always deliver hover events to disabled items. This patch will therefore change the test, so that we always check if subtreeHoverEnabled is set before we recurse into the child. Whether or not the item is enabled or disabled is not relevant, and therefore removed. This will ensure that we e.g don't visit all the delegate items in a TableView for each pointer move, just because TableView itself subscribes to hover (unless the delegate is also subscribing to hover). Note: This patch is only an optimization, and shouldn't affect which items and handlers we end up actually delivering hover events to. It will only stop the DA from recursing into too many items. Amends 831efa14e91cfa358e57a32197578d41c2ae1b24 Change-Id: I6ddf963c3ac99ef54da08f64dc5660bc35a295e0 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> (cherry picked from commit e3a8d8136706c9c50d76a39b72ab90cced34cca7) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r--src/quick/util/qquickdeliveryagent.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/quick/util/qquickdeliveryagent.cpp b/src/quick/util/qquickdeliveryagent.cpp
index 90d154ff5d..610fa409ac 100644
--- a/src/quick/util/qquickdeliveryagent.cpp
+++ b/src/quick/util/qquickdeliveryagent.cpp
@@ -1071,7 +1071,7 @@ bool QQuickDeliveryAgentPrivate::deliverHoverEventRecursive(
if (!child->isVisible() || childPrivate->culled)
continue;
- if (!child->isEnabled() && !childPrivate->subtreeHoverEnabled)
+ if (!childPrivate->subtreeHoverEnabled)
continue;
if (childPrivate->flags & QQuickItem::ItemClipsChildrenToShape) {
const QPointF localPos = child->mapFromScene(scenePos);