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

activeFocusChanged signal is not emitted for FocusScope (with testcase)

XMLWordPrintable

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

      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()
          }
        }
      }
      

        For Gerrit Dashboard: QTBUG-25644
        # Subject Branch Project Status CR V

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

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes