summaryrefslogtreecommitdiffstats
path: root/src/webenginewidgets/api/qtwebenginewidgetsglobal.cpp
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2016-11-21 11:33:06 +0100
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2016-11-21 11:33:06 +0100
commitb44962c8bce5489deee289212282cdf2c89b425a (patch)
tree796eeb5c5008a53d61e7cc970d90aed5e7d3b530 /src/webenginewidgets/api/qtwebenginewidgetsglobal.cpp
parent7a4324f5e4c3927b51e4176daf0d8ae6599c984a (diff)
parent15ded5ca62f53a01f85a52326f0b335a8a012bbd (diff)
Merge remote-tracking branch 'origin/5.7.1' into 5.7
Diffstat (limited to 'src/webenginewidgets/api/qtwebenginewidgetsglobal.cpp')
-rw-r--r--src/webenginewidgets/api/qtwebenginewidgetsglobal.cpp19
1 files changed, 12 insertions, 7 deletions
diff --git a/src/webenginewidgets/api/qtwebenginewidgetsglobal.cpp b/src/webenginewidgets/api/qtwebenginewidgetsglobal.cpp
index e47f135e8..bf3514f71 100644
--- a/src/webenginewidgets/api/qtwebenginewidgetsglobal.cpp
+++ b/src/webenginewidgets/api/qtwebenginewidgetsglobal.cpp
@@ -48,17 +48,22 @@ namespace QtWebEngineCore
}
QT_BEGIN_NAMESPACE
+
+Q_GUI_EXPORT QOpenGLContext *qt_gl_global_share_context();
+
static void initialize()
{
- //On window/ANGLE, calling QtWebEngine::initialize from DllMain will result in a crash.
- //To ensure it doesn't, we check that when loading the library
- //QCoreApplication is not yet instantiated, ensuring the call will be deferred
-#if defined(Q_OS_WIN)
- if (QCoreApplication::instance()
- && QOpenGLContext::openGLModuleType() == QOpenGLContext::LibGLES) {
+ if (QCoreApplication::instance()) {
+ //On window/ANGLE, calling QtWebEngine::initialize from DllMain will result in a crash.
+ if (!qt_gl_global_share_context()) {
+ qWarning("Qt WebEngine seems to be initialized from a plugin. Please "
+ "set Qt::AA_ShareOpenGLContexts using QCoreApplication::setAttribute "
+ "before constructing QGuiApplication.");
+ }
return;
}
-#endif
+
+ //QCoreApplication is not yet instantiated, ensuring the call will be deferred
qAddPreRoutine(QtWebEngineCore::initialize);
}