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

ActiveFocus property appears to change unnecessarily

    XMLWordPrintable

Details

    Description

      When navigating through items of a listview, the activeFocus property of the ListView toggles seemingly unnecessarily.

      The root item's activeFocus does not change but the signal onActiveFocusChanged fires anyway. root item is not part of a focus scope.

      import QtQuick 1.0
      
      Column {
          id: root
          focus: true
      
          onActiveFocusChanged: console.log("root activeFocus changed " + root.activeFocus)
      
          ListView {
              model: 10
              width: 200
              height: 200
              focus: true
              id: lv
      
              onActiveFocusChanged: console.log("listview activeFocus changed " + lv.activeFocus)
      
              delegate : Text { 
                      width: parent.width; 
                      text: model.modelData + " is the " + (activeFocus ? " activeFocus" : "") + (focus ? " focus" : "") + " item" ;
                      font.bold: true
                      color: activeFocus ? "red" : (focus ? "green" : "black")
                          }
          }
      
      }
      

      Attachments

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

        Activity

          People

            brasser Michael Brasser (closed Nokia identity) (Inactive)
            girish Girish Ramakrishnan
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes