summaryrefslogtreecommitdiffstats
path: root/src/webengine/api/qtwebengineglobal.cpp
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2019-11-25 09:47:18 +0100
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2019-11-25 09:47:18 +0100
commitcda76002257d56ffedbf8d28211cfd66a7226e73 (patch)
tree03e8a7fcdfa389771d6ade5afbe5d2536328eef2 /src/webengine/api/qtwebengineglobal.cpp
parentb97f0eb87b6e6a6726b805c9de2159c6ad983f7d (diff)
parent631f1dd72027207cf6c49a380671c58f096a37a5 (diff)
Merge remote-tracking branch 'origin/5.15' into dev
Conflicts: src/core/api/qtbug-60565.cpp Change-Id: Iaad05aa248fb57a69033013161e10e3acddd48f6
Diffstat (limited to 'src/webengine/api/qtwebengineglobal.cpp')
-rw-r--r--src/webengine/api/qtwebengineglobal.cpp15
1 files changed, 12 insertions, 3 deletions
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 <QCoreApplication>
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