summaryrefslogtreecommitdiffstats
path: root/src/webengine/api/qquickwebengineview_p_p.h
diff options
context:
space:
mode:
authorJocelyn Turcotte <jocelyn.turcotte@digia.com>2015-01-29 12:06:28 +0100
committerAndras Becsi <andras.becsi@theqtcompany.com>2015-02-05 13:10:41 +0000
commitfaec509a21b4700dbf271c4dcbb3a993f1c4042f (patch)
treedd16a33ab7070ab52e34843f666f1e6c87fdc5bf /src/webengine/api/qquickwebengineview_p_p.h
parent0622e02b9da5b93c6824367732970af0214601fb (diff)
Propagate unhandled key events to the QtWebEngine view's parent
This allows applications to receive unhandled key events from the page by setting an event handler on the view's parent widget/item, like it was possible with QtWebKit. This is different in that events first have to asynchronously go through the QtWebEngineProcess. If the WebEngine view has the keyboard focus, the events will be consumed inconditionally by the RenderWidgetHostViewQtDelegates, and a copy will be resent to the view's parent if it wasn't consumed. This sends it to the parent instead of the QWebEngineView directly since those are only unhandled events, unlike with other widgets where you can first intercept events. It is done that way also in cases where the QWebEngineView would be be the focus widget directly in the future, instead of the RWHV. If applications want to intercept key events before they reach the page, they need to use an event filter on the QWebEngineView's children or globally on the application. Change-Id: I3b48f5212d3f238a1c0497cec1db6ae3badbad26 Reviewed-by: Andras Becsi <andras.becsi@theqtcompany.com>
Diffstat (limited to 'src/webengine/api/qquickwebengineview_p_p.h')
-rw-r--r--src/webengine/api/qquickwebengineview_p_p.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/webengine/api/qquickwebengineview_p_p.h b/src/webengine/api/qquickwebengineview_p_p.h
index 1c1334ee6..28c8ff44e 100644
--- a/src/webengine/api/qquickwebengineview_p_p.h
+++ b/src/webengine/api/qquickwebengineview_p_p.h
@@ -155,6 +155,7 @@ public:
virtual void loadVisuallyCommitted() Q_DECL_OVERRIDE;
virtual void loadFinished(bool success, const QUrl &url, int errorCode = 0, const QString &errorDescription = QString()) Q_DECL_OVERRIDE;
virtual void focusContainer() Q_DECL_OVERRIDE;
+ virtual void unhandledKeyEvent(QKeyEvent *event) Q_DECL_OVERRIDE;
virtual void adoptNewWindow(WebContentsAdapter *newWebContents, WindowOpenDisposition disposition, bool userGesture, const QRect &) Q_DECL_OVERRIDE;
virtual void close() Q_DECL_OVERRIDE;
virtual void requestFullScreen(bool) Q_DECL_OVERRIDE;