path: root/src/webenginewidgets/render_widget_host_view_qt_delegate_widget.cpp
diff options
authorAllan Sandfeld Jensen <>2016-06-20 17:14:35 +0200
committerAllan Sandfeld Jensen <>2016-06-22 13:53:40 +0000
commite0bd650cb7f8c8fd3014541b4c49104906e0e139 (patch)
tree76b7ed34eb9dd5e1b60698c0851b64414f182c4b /src/webenginewidgets/render_widget_host_view_qt_delegate_widget.cpp
parent7494836e3a1e61a000fa0f73f91665fa291ec287 (diff)
Override short-cuts to common editor commands
To ensure Chromium is given a chance to handle editor commands, we must override these short-cuts. On OS X we must also perform the action afterwards as these are not handled internally by the Blink Editor. The patch solves copy/paste in flash plugins and copy/paste on OS X when no application short-cuts have been defined. The handling of short-cut override events is based on how it was handled in Qt WebKit Task-number: QTBUG-54221 Change-Id: I748671c7bfa5662aae16c6a4b9bbe5e2bce1b907 Reviewed-by: Alexandru Croitor <>
Diffstat (limited to 'src/webenginewidgets/render_widget_host_view_qt_delegate_widget.cpp')
1 files changed, 7 insertions, 0 deletions
diff --git a/src/webenginewidgets/render_widget_host_view_qt_delegate_widget.cpp b/src/webenginewidgets/render_widget_host_view_qt_delegate_widget.cpp
index 78840085f..2937c94b7 100644
--- a/src/webenginewidgets/render_widget_host_view_qt_delegate_widget.cpp
+++ b/src/webenginewidgets/render_widget_host_view_qt_delegate_widget.cpp
@@ -323,6 +323,13 @@ bool RenderWidgetHostViewQtDelegateWidget::event(QEvent *event)
+ if (event->type() == QEvent::ShortcutOverride) {
+ if (editorActionForKeyEvent(static_cast<QKeyEvent*>(event)) != QWebEnginePage::NoWebAction) {
+ event->accept();
+ return true;
+ }
+ }
if (event->type() == QEvent::MouseButtonDblClick) {
// QWidget keeps the Qt4 behavior where the DblClick event would replace the Press event.
// QtQuick is different by sending both the Press and DblClick events for the second press