path: root/src/webengine/render_widget_host_view_qt_delegate_quick.h
diff options
authorJocelyn Turcotte <>2013-12-16 12:53:30 +0100
committerThe Qt Project <>2013-12-23 11:09:21 +0100
commit7d39fa4acaa38dbaa1977cbff6500f338a59250c (patch)
tree11d08d555abdf904608467392112fc1a24d88ccb /src/webengine/render_widget_host_view_qt_delegate_quick.h
parente78497c702447ce15369e18828bf1dc1aa073620 (diff)
createWindow QML API for QQuickWebEngineView
This implements adoptNewWindow for QQuickWebEngineView. The API is only intended to be used through QML to avoid delegating the QQuickWebEngineViewHandle ownership through a signal parameter. Another limitation of the implementation is currently to fail the handle adoption unless it is done synchronously within the adoptNewWindow call. To support this we would need to delay the call to WebContentsAdapter::initialize which will leave the adapter without a client when returning to the event loop and would require putting null checks everywhere it is used. So I would prefer to keep the API limited and avoid potential crashes. If we want to support asynchronous Loader elements or QML files fetched from the network in the future, the API should be able to scale to the task once we've adjusted the implementation. This also adds basic tabs support in the quicknanobrowser example. The url property is now set imperatively to avoid overwriting the adopted WebContentsAdapter's loading URL. Change-Id: Iba5c5dc3ffa21045f356be131ca15c01b9aee7c8 Reviewed-by: Pierre Rossi <> Reviewed-by: Zeno Albisser <>
Diffstat (limited to 'src/webengine/render_widget_host_view_qt_delegate_quick.h')
1 files changed, 1 insertions, 0 deletions
diff --git a/src/webengine/render_widget_host_view_qt_delegate_quick.h b/src/webengine/render_widget_host_view_qt_delegate_quick.h
index e8e073c24..b31a9c873 100644
--- a/src/webengine/render_widget_host_view_qt_delegate_quick.h
+++ b/src/webengine/render_widget_host_view_qt_delegate_quick.h
@@ -68,6 +68,7 @@ public:
QQuickWebEngineViewPrivate *viewPrivate = static_cast<QQuickWebEngineViewPrivate *>(container);
+ this->setSize(viewPrivate->q_func()->boundingRect().size());
virtual void initAsPopup(const QRect& rect) Q_DECL_OVERRIDE