Details
-
Bug
-
Resolution: Done
-
P2: Important
-
4.8.1
-
None
-
Ubuntu 12.04, gcc 4.6, Qt 4.8.1
Description
Run the following example (you may uncomment the only commented-away code line to see some more interesting behavior).
Note that the properties bound to FocusScope's "focus" don't get updated.
import QtQuick 1.1 FocusScope { id: root width: 600 height: 200 Item { anchors.fill: parent focus: true Text { font.pointSize: 20 anchors.centerIn: parent text: "foci: " + root.focus //text is aways "foci: false" if the next line is commented // + "/" + root.activeFocus //uncomment to produce "foci: true/true" } } property bool rootFocus: root.focus //always false Keys.onPressed: console.log("key, root.focus: " + root.focus + ", rootFocus: " + rootFocus) //always (true,false) Component.onCompleted: forceActiveFocus() }
The code example above is also attached as a file.