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

Loader's item retains focus

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P2: Important P2: Important
    • None
    • 6.6.2
    • None

      When using a Loader to dynamically load components, the focus property of the Loader's item seems to not reset once the focus leaves the Loader.

      The following MWE shows the issue; by using Tab the focus may be moved between the Loader and the descriptive text.

      import QtQuick
      import QtQuick.Controls
      
      ApplicationWindow {
      	id: root
      
      	height: 480
      	visible: true
      	width: 640
      
      	Column {
      		anchors.centerIn: parent
      
      		Loader {
      			id: loader
      
      			sourceComponent: Button {
      				activeFocusOnTab: true
      				text: "Loader focus: %1\nButton focus: %2".arg(loader.focus).arg(focus)
      			}
      		}
      		Text {
      			activeFocusOnTab: true
      			text: "Loader focus: %1\nButton focus: %2".arg(loader.focus).arg(loader.item.focus)
      		}
      	}
      }
      

      While the focus property of the Loader will be the false after leaving it, the Button retains its focus.

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

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            janmoeller Jan Möller
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:

                There are no open Gerrit changes