aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/items/qquickitem_p.h
diff options
context:
space:
mode:
authorVolker Hilsheimer <volker.hilsheimer@qt.io>2021-07-22 22:32:41 +0200
committerVolker Hilsheimer <volker.hilsheimer@qt.io>2021-12-04 22:13:52 +0100
commit61ee61d8c977ecf876ce1d364cff634467b562a9 (patch)
tree2fde3d6b2405f5129e7456700951364fb0f699f3 /src/quick/items/qquickitem_p.h
parentb7b5127747e3be2b12a70bf9c460e96d7a711496 (diff)
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 <shawn.rutledge@qt.io>
Diffstat (limited to 'src/quick/items/qquickitem_p.h')
-rw-r--r--src/quick/items/qquickitem_p.h1
1 files changed, 1 insertions, 0 deletions
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
};