diff options
Diffstat (limited to 'src/core/content_browser_client_qt.cpp')
-rw-r--r-- | src/core/content_browser_client_qt.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
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 <QGuiApplication> +#include <QtGui/private/qopenglcontext_p.h> #include <QtQuick/private/qsgcontext_p.h> #include <qpa/qplatformnativeinterface.h> @@ -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)); } |