Comment 8 for bug 1313727

Revision history for this message
Chris Coulson (chrisccoulson) wrote :

Ok, I think I understand now:

First of all - we probably want to dispatch the returned event synchronously rather than posting an event to the event loop. So, sendEvent() would be more appropriate than postEvent(). Although, that's not the issue at play here.

When doing either QCoreApplication::postEvent() or QCoreApplication::sendEvent(), this is delegated to a virtual function - QCoreApplication::notify(), which is implemented by QGuiApplication. In the case here, we literally just dispatch the event to the webview, and leave it at that.

The mechanism for propagating events to parent widgets is actually implemented in QApplication::notify(), and we don't have one of those. To dispatch an event in QtQuick that propagates through to parent items, you need to use QQuickWindow::sendEvent():

http://qt-project.org/doc/qt-5/qquickwindow.html#sendEvent.

So, I think we need to delegate the dispatching of the QKeyEvent to WebViewAdapter, and do this call in OxideQQuickWebViewPrivate