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

Setting the focus of a FocusScope to false doesn't remove active focus from child items.

    XMLWordPrintable

Details

    Description

      If I have a TextInput inside a FocusScope such as in the application below, I would expect setting the focus property of the FocusScope to false to remove activeFocus from the TextInput. Instead the TextInput activeFocus property is unchanged and the input continues to receive key events.

      import QtQuick 1.0
      
      MouseArea {
          width: 300; height: 300
      
          onClicked: scope.focus = false
      
          Rectangle {
              anchors.centerIn: parent
              width: 200; height: input.implicitHeight + 4
              border.width: 1
              color: input.activeFocus ? "white" : "grey"
      
              FocusScope {
                  id: scope
                  anchors.fill: parent
                  TextInput {
                      id: input
                      anchors { fill: parent; margins: 2 }
                      focus: true
                  }
              }
          }
      }
      

      Attachments

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

        Activity

          People

            denexter Andrew den Exter (closed Nokia identity) (Inactive)
            denexter Andrew den Exter (closed Nokia identity) (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes