From 96425960f9d57387c33e3ba50785aaa81255bc98 Mon Sep 17 00:00:00 2001 From: Jocelyn Turcotte Date: Fri, 28 Mar 2014 17:14:30 +0100 Subject: Render the widgets view using the scene graph into a QOpenGLWidget This means that widgets application now need to setup the GL context sharing as well. QWebEngineWidgets::initialize() must be called, which has the same effect as QWebEngine::initialize(). The QtWebEngineWidgets now depends on the QtWebEngine module to make this happen. Since QOpenGLWidget is only available in Qt 5.3, this patch also disables the webenginewidgets module completely when building using Qt 5.2. Change-Id: I0e99a779d1eb080f2ccf5a338ff0763ad64e6eba Reviewed-by: Simon Hausmann --- src/core/content_browser_client_qt.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/core/content_browser_client_qt.cpp') diff --git a/src/core/content_browser_client_qt.cpp b/src/core/content_browser_client_qt.cpp index 628aa6ed2..86ff11efb 100644 --- a/src/core/content_browser_client_qt.cpp +++ b/src/core/content_browser_client_qt.cpp @@ -58,6 +58,7 @@ #include "web_contents_view_qt.h" #include +#include #include #include @@ -248,9 +249,13 @@ private: void ShareGroupQtQuick::AboutToAddFirstContext() { // This currently has to be setup by ::main in all applications using QQuickWebEngineView with delegated rendering. +#if (QT_VERSION < QT_VERSION_CHECK(5, 3, 0)) QOpenGLContext *shareContext = QSGContext::sharedOpenGLContext(); +#else + QOpenGLContext *shareContext = QOpenGLContextPrivate::globalShareContext(); +#endif if (!shareContext) { - qFatal("QWebEngine: OpenGL resource sharing is not set up in QtQuick. Please make sure to call QWebEngine::initialize() in your main() function."); + qFatal("QWebEngine: OpenGL resource sharing is not set up in QtQuick. Please make sure to call QWebEngine::initialize() or QWebEngineWidgets::initialize() in your main() function."); } m_shareContextQtQuick = make_scoped_refptr(new QtShareGLContext(shareContext)); } -- cgit v1.2.3