Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-132568

QQuickItem::focusPolicy vs QQuickItem::activeFocusOnTab(

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 6.7.3
    • Quick: Other
    • None
    • All

    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:

      1. 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().
      2. when calling setActiveFocusOnTab( false ) manually the TabFocus bit is not cleared and no focusPolicyChanged is triggered.
      3. 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.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            uwe Uwe Rathmann
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes