path: root/src/core/content_browser_client_qt.cpp
diff options
authorSimon Hausmann <>2014-03-26 12:21:25 +0100
committerThe Qt Project <>2014-03-31 18:36:46 +0200
commit3d6d6594b0dd2a8860b8fddd5a58f86c4ebd255c (patch)
tree5a9959d433425d8ff1a1d78d1b2506a1fd147770 /src/core/content_browser_client_qt.cpp
parent3512a6cfe07cb7108485b3e39d586612aa5ed3d8 (diff)
Centralize OpenGL initialization
We now require the user to use QWebEngine::initialize() in main (preferably) and print out an error message if this wasn't set up accordingly. This limits the use of private scene graph API to inside QWebEngine and offers public API for users of the API. Change-Id: I787c176a85ab7784dbc8787d9876960b4872959e Reviewed-by: Jocelyn Turcotte <>
Diffstat (limited to 'src/core/content_browser_client_qt.cpp')
1 files changed, 3 insertions, 1 deletions
diff --git a/src/core/content_browser_client_qt.cpp b/src/core/content_browser_client_qt.cpp
index 99862235f..628aa6ed2 100644
--- a/src/core/content_browser_client_qt.cpp
+++ b/src/core/content_browser_client_qt.cpp
@@ -249,7 +249,9 @@ void ShareGroupQtQuick::AboutToAddFirstContext()
// This currently has to be setup by ::main in all applications using QQuickWebEngineView with delegated rendering.
QOpenGLContext *shareContext = QSGContext::sharedOpenGLContext();
- Q_ASSERT(shareContext);
+ if (!shareContext) {
+ qFatal("QWebEngine: OpenGL resource sharing is not set up in QtQuick. Please make sure to call QWebEngine::initialize() in your main() function.");
+ }
m_shareContextQtQuick = make_scoped_refptr(new QtShareGLContext(shareContext));