Does the FocusScope only works on child elements "focus" property or does it also considers the grand childerens "focus" property also.
i.e. In the below code, since the Rectangle element is not a direct child of FocusScope, will it take in to account while setting the focus.
import QtQuick 1.1
FocusScope {
width: 100
height: 66
Row {
Rectangle {
width: 100
height: 62
focus: true
color: "red"
Keys.onPressed: {
console.log("hello")
}
}
}
}
Based on the output of the program, it looks like FocusScope takes Rectangle element in to account while setting the focus. This feature is not documented.
From http://qt-project.org/doc/qt-4.8/qdeclarativefocus.html#qmlfocus Qt docs "Within each focus scope one element may have Item::focus set to true. If more than one Item has the focus property set, the last element to set the focus will have the focus and the others are unset, similar to when there are no focus scopes."
It is not clear whether the FocusScope considers the grandchildrens(childrens of childrens) "focus" property.
focus
oractiveFocus
), and was redone for QML 2, iirc; beware :) – mlvljr