Details
-
Suggestion
-
Resolution: Unresolved
-
Not Evaluated
-
None
-
None
-
None
Description
When using QQuickRenderControl one is supposed to manually forward events to the target QQuickWindow. Pointer events (mouse, etc.) seem to require some mapping in order to account with the fact that there's no real scene, for instance the examples do:
void WindowSingleThreaded::mousePressEvent(QMouseEvent *e) { // Use the constructor taking position and globalPosition. That puts position into the // event's position and scenePosition, and globalPosition into the event's globalPosition. This way // the scenePosition in e is ignored and is replaced by position. This is necessary // because QQuickWindow thinks of itself as a top-level window always. QMouseEvent mappedEvent(e->type(), e->position(), e->globalPosition(), e->button(), e->buttons(), e->modifiers()); QCoreApplication::sendEvent(m_quickWindow, &mappedEvent); }
It would be more appropriate to have an event forwarder utility method on QQuickRenderControl ,so that it can do any necessary modifications to input events internally.