From 831efa14e91cfa358e57a32197578d41c2ae1b24 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Wed, 19 Jun 2019 12:54:43 +0200 Subject: Update hovered on disabled QQuickItems Changes handling of hovered so that the property is still updated on disabled items, so that other items can bind to it. This is in particular useful for tooltips. [ChangeLog][Behavior Changes] QQuickItem::hovered will now update even when the item is disabled. Fixes: QTBUG-30801 Pick-to: 6.0 Change-Id: Id17298f657d7631b0e5019138ba33a7d5f863475 Reviewed-by: Fabian Kosmale Reviewed-by: Allan Sandfeld Jensen Reviewed-by: Shawn Rutledge --- src/quick/items/qquickwindow.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/quick/items/qquickwindow.cpp b/src/quick/items/qquickwindow.cpp index 6a57553b21..446573aae8 100644 --- a/src/quick/items/qquickwindow.cpp +++ b/src/quick/items/qquickwindow.cpp @@ -2152,7 +2152,9 @@ bool QQuickWindowPrivate::deliverHoverEvent(QQuickItem *item, const QPointF &sce QList children = itemPrivate->paintOrderChildItems(); for (int ii = children.count() - 1; ii >= 0; --ii) { QQuickItem *child = children.at(ii); - if (!child->isVisible() || !child->isEnabled() || QQuickItemPrivate::get(child)->culled) + if (!child->isVisible() || QQuickItemPrivate::get(child)->culled) + continue; + if (!child->isEnabled() && !QQuickItemPrivate::get(child)->subtreeHoverEnabled) continue; if (deliverHoverEvent(child, scenePos, lastScenePos, modifiers, timestamp, accepted)) return true; -- cgit v1.2.3