Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
6.7.3
-
None
Description
With Qt 6.7 the focusPolicy property has been shifted from QQuickControl to QQuickItem.
The TabFocus bit corresponds to the activeFocusOnTab() flag that has always been part of QQuickItem and the same information is stored twice now:
- when clearing the Qt::TabFocus bit for the activeFocusItem() of the window the setActiveFocusOnTab( false ) call fails. The focusPolicyChanged() signal reports a different policy than what you get from QQuickItem::focusPolicy().
- when calling setActiveFocusOnTab( false ) manually the TabFocus bit is not cleared and no focusPolicyChanged is triggered.
- when calling setActiveFocusOnTab( false ) manually the TabFocus bit is not cleared and QQuickItem::focusPolicy reports the wrong information
IMO it would be better to simply set the activeFocusOnTab() flag on the TabFocus bit instead of having the information at 2 places. The other solution would be to always clear the TabFocus bit when setting the focusPolicy and restoring it in the getter ( like it is already done in QQuickItem::focusPolicy() )
By the way: in the Qskinny project I avoid the problem of the activeFocusItem by shifting the focus to the next item in the tab chain ( QQuickItem::nextItemInFocusChain() ) before clearing the activeFocusOnTab bit.