Details
-
Bug
-
Resolution: Done
-
P2: Important
-
4.7.0
-
None
-
eb8c7d19c98d547f89caa1b5866fd2b5e43b32bf 4ad82cec67ce40dd167be214a2a4dcdcf6236d9d
Description
onFocusChanged is not being emitted when the item is inside a FocusScope, even if the FocusScope has activeFocus.
Steps to reproduce:
1. Load app.qml below in qmlviewer
2. Click on each red square. Nothing happen. Expected: the square that got the focus should become yellow
3. Remove the FocusScope, and it works as expected
MyComponent.qml
import Qt 4.7 Rectangle { id: rect width: 100 height: 100 color: "red" states: State { name: "highlight"; when: rect.focus PropertyChanges { target: rect; color: "yellow"} } MouseArea { anchors.fill: parent onClicked: { rect.focus = true } } }
app.qml
import Qt 4.7 Rectangle { width: 300 height: 300 FocusScope { // remove the FocusScope and it works focus: true MyComponent {y: 0} MyComponent {y: 130} } }