QQuickWindow is created from QQuickRenderControl and used as GUI overlay for an application. Input event loop is outside of Qt, so the events are sent manually through QCoreApplication::sendEvent.

Injecting mouse with QCoreApplication::instance()->sendEvent(quickWindow, event) works for push/release/move: can click buttons and select text in TextFields.

But I can't get the keyboard to work: it's not possible to edit the text in the TextField, cursor doesn't appear.

I've tried sending QFocusEvent, but it does nothing.

Also tried to setFocus and send QFocusEvent to the window and specific TextField. That got TextField into focus, but I'm not going to reimplement the focus rules.

How it's supposed to work?