Hey,

I'm working on a library that overlays qt widgets and qml on top of a 3D scene 
by rendering the controls into an image and overlaying this image on the 3D 
scene.
This works quite well for QWidgets where I simply  do the event handling and 
especially the focus handling myself. No flashing cursor but I can live with 
that.
However, QML is not as easy. Mouse interaction works quite well because it 
suffices to pass the event to the QQuickWindow.
Keyboard interaction, however, is a lot harder because the elements don't get 
focus.
I've tried keeping track of the focused item myself but this proved harder than 
I thought if not impossible.
For instance, in a qml TextField control, the click might be on the text which 
will allow me to write text because the key events end up at the right element 
but if the user clicks next to the text, the element that I find is different 
and it won't work.
The problem here is probably that in normal cases clicks outside are handled by 
a mousearea that sets the focus to the editable element.

Any idea, how I can track the element that should have focus?
Or, how I could enable the QQuickWindow that is rendered offscreen using a 
QQuickRenderControl to handle focus by itself?
Qt version is 5.5.1

Best,
Stefan

_______________________________________________
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest

Reply via email to