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

activeFocusChanged signal is not emitted for FocusScope (with testcase)

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Not Evaluated
    • 4.8.5
    • 4.8.0, 4.8.1
    • None
    • Mac OS X

    Description

      In the following example a click on the text gives active focus to the FocusScope a.

      Although the activeFocus property of a is now true (see the resulting text property of t), no change signal is emitted (the console ouput "activeFocusChanged (a) true is never printed).
      The update of the text property works only because it also depends on t.activeFocus, which is handled correctly.

      import QtQuick 1.1
      
      FocusScope {
        id: a
        width: 360
        height: 360
      
        onActiveFocusChanged: console.log("activeFocusChanged (a) " + activeFocus)
      
        Text {
          id: t
          focus: true
          anchors.centerIn: parent
          text: "a: " + a.activeFocus + " t: " + activeFocus
      
          onActiveFocusChanged: console.log("activeFocusChanged (t) " + activeFocus)
      
          MouseArea {
            anchors.fill: parent
            onClicked: a.forceActiveFocus()
          }
        }
      }
      

      Attachments

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

        Activity

          People

            bibr Andreas Aardal Hanssen
            njeisecke Nils Jeisecke
            Votes:
            1 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes