From 61ee61d8c977ecf876ce1d364cff634467b562a9 Mon Sep 17 00:00:00 2001 From: Volker Hilsheimer Date: Thu, 22 Jul 2021 22:32:41 +0200 Subject: Fix setting the focus reason in Qt Quick Controls Focus might go to the content item, which is a QQuickItem that has no concept of either focusPolicy or focusReason. For Qt Quick Controls to update the focusReason property when an item in it's item tree receives or loses focus, it has to install itself as a notification listener on the item. However, QQuickItemChangeListener didn't have any notification type for focus changes. Add the new change type, and notify listeners whenever the an item's focus changes. Focus scoping might mean that an item never loses focus, but nevertheless loses active focus. To be able to update items recursively with the correct focusReason, add the reason parameter to the QQuickDeliveryAgent helper function. Fixes: QTBUG-75862 Pick-to: 6.2 Change-Id: I3d19b722bb07b55416b8cfbb4a9cdb0edd0da3ec Reviewed-by: Shawn Rutledge --- src/quick/items/qquickitem_p.h | 1 + 1 file changed, 1 insertion(+) (limited to 'src/quick/items/qquickitem_p.h') diff --git a/src/quick/items/qquickitem_p.h b/src/quick/items/qquickitem_p.h index 576d392a26..6be15c4f3a 100644 --- a/src/quick/items/qquickitem_p.h +++ b/src/quick/items/qquickitem_p.h @@ -331,6 +331,7 @@ public: ImplicitWidth = 0x100, ImplicitHeight = 0x200, Enabled = 0x400, + Focus = 0x800, AllChanges = 0xFFFFFFFF }; -- cgit v1.2.3