From 229621361562d0e89aeb5f2d2f0ace0115bf164c Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Wed, 2 Oct 2019 16:23:09 +0200 Subject: Merge remote-tracking branch 'origin/5.13' into 5.14 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Conflicts: examples/webengine/minimal/main.cpp src/3rdparty src/core/net/url_request_custom_job.cpp tests/auto/widgets/qwebengineprofile/tst_qwebengineprofile.cpp Change-Id: I33994024a4be5ed787800c5718a0a443b970c36d Reviewed-by: Jüri Valdmann --- src/webengine/api/qtwebengineglobal.cpp | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'src/webengine') diff --git a/src/webengine/api/qtwebengineglobal.cpp b/src/webengine/api/qtwebengineglobal.cpp index a11618dba..4346832c9 100644 --- a/src/webengine/api/qtwebengineglobal.cpp +++ b/src/webengine/api/qtwebengineglobal.cpp @@ -38,6 +38,7 @@ ****************************************************************************/ #include "qtwebengineglobal.h" +#include namespace QtWebEngineCore { @@ -62,8 +63,8 @@ namespace QtWebEngine { /*! \fn QtWebEngine::initialize() - Sets up an OpenGL Context that can be shared between threads. This has to be done after - QGuiApplication is created, but before a Qt Quick window is created. + Sets up an OpenGL Context that can be shared between threads. This has to be done before + QGuiApplication is created and before window's QPlatformOpenGLContext is created. This has the same effect as setting the Qt::AA_ShareOpenGLContexts attribute with QCoreApplication::setAttribute before constructing @@ -71,7 +72,15 @@ namespace QtWebEngine { */ void initialize() { - QtWebEngineCore::initialize(); + QCoreApplication *app = QCoreApplication::instance(); + if (app) { + qWarning("QtWebEngine::initialize() called with QCoreApplication object already created and should be call before. "\ + "This is depreciated and may fail in the future."); + QtWebEngineCore::initialize(); + return; + } + // call initialize the same way as widgets do + qAddPreRoutine(QtWebEngineCore::initialize); } } // namespace QtWebEngine -- cgit v1.2.3