This may be related to bug 15047:
We are developing an embedded linux Qtopia application that mainly uses QGraphicsView and Qt components, but also mixes in QML items to the same (only) scene. We experience the following: The QML text line component (which is wrapped in a few other qml parents inside the QML file) looses focus when clicked outside it (which is correct since the QGraphicsScene stickyFlag is false). However, the QML text input element does not actually recognize this.
We observe this in two ways:
1. The border color of the text line (or rather, its parent rectangle) is bound directly to the text input active focus property.
2. The cursor is still blinking in the line edit (this is perhaps the strongest indicator)
3. The onActiveFocusChanged() handler of the text input has been implemented with console.log messages. But the line focus does not reporting loosing active focus in the concerned situations.
We know that the line edit has actually lost focus because:
1. Typing anything on the keyboard does not appear in the text field anymore
2. Quering the scene's focusItem() method returns 0 (we have verified that the scene/graphicsview itself still has focus with QApplication::focusItem())
What's even stranger is that the situation is very unpredictable, clicking the same spots on the outside regions on the screen sometimes lead to the loss of focus, sometimes not.
We know that focus issues can be caused by a lot of misunderstanding and confused implementation details by the client, but in this case we have been through the documentation in great detail.
Anyway, whether or not this is a bug can simply be answered with the following question: Is there any possible (legal) situation that a QML component that has active focus, can loose it's active focus without the onActiveFocusChanged() method being called? Because this is what we clearly see.
Obviously the fact that the lineedit seems active, with blinking cursor, but not receives key input is a big problem for us and prevents our usage of QML currently.
Btw there is currently no focus scopes involved but we can't see that this is related here.
Our toolchain is Qt 4.7.4. QWS is also used.
(Please note my Qt license is pending, I am newhire at Cisco Norway)