diff options
author | Alexandru Croitor <alexandru.croitor@qt.io> | 2017-01-31 15:01:43 +0100 |
---|---|---|
committer | Alexandru Croitor <alexandru.croitor@qt.io> | 2017-02-20 12:42:40 +0000 |
commit | a6c6665d79e6d4097c0a1155ff5f963b9a9eab19 (patch) | |
tree | 407d18d34eaff097e0b6ebf26d101895c0f4dc49 /src/webenginewidgets | |
parent | 8666e9d50346ce4ae68b577812282b7bc17b41c9 (diff) |
Fix QWebEngineView::setFocus to properly set internal QQuickItem focus
The widgets object hierarchy related to focus goes like this:
QWebEngineView's focus proxy is ->
RenderWidgetHostViewQtDelegateWidget, which has an internal
QQuickRootItem defined by QQuickWidget, and the child of the item is ->
RenderWidgetHostViewQuickItem.
Previously when QWebEngineView::setFocus was called, the focus was set
on the RenderWidgetHostViewQtDelegateWidget and the QQuickRootItem,
but not on the RenderWidgetHostViewQuickItem. This caused for e.g.
an active HTML text input not receiving focus.
Make sure the RenderWidgetHostViewQuickItem is marked to have focus
within its root item, so that if the root item receives active focus,
so will RenderWidgetHostViewQuickItem receive it.
Task-number: QTBUG-58515
Change-Id: I175610e3dfebc03733aefe26c16f47096df8ff5b
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'src/webenginewidgets')
-rw-r--r-- | src/webenginewidgets/render_widget_host_view_qt_delegate_widget.cpp | 2 |
1 files changed, 2 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 69ecbe160..e4c8996e1 100644 --- a/src/webenginewidgets/render_widget_host_view_qt_delegate_widget.cpp +++ b/src/webenginewidgets/render_widget_host_view_qt_delegate_widget.cpp @@ -64,6 +64,8 @@ public: RenderWidgetHostViewQuickItem(RenderWidgetHostViewQtDelegateClient *client) : m_client(client) { setFlag(ItemHasContents, true); + // Mark that this item should receive focus when the parent QQuickWidget receives focus. + setFocus(true); } protected: void focusInEvent(QFocusEvent *event) override |