summaryrefslogtreecommitdiffstats
path: root/examples/webengine/recipebrowser
diff options
context:
space:
mode:
authorMichal Klocek <michal.klocek@qt.io>2019-09-18 10:53:38 +0200
committerMichal Klocek <michal.klocek@qt.io>2019-09-26 10:28:20 +0000
commite77ec61b7ba1fb71b397ef358036b5057a0cb39b (patch)
treed92613a60773af306b0c78fbae2622bedacdf8ea /examples/webengine/recipebrowser
parente31acc86e991d6f83bd56eebb7371914fc9ca5ac (diff)
Unify shared context initialization
Setting shared context on core application object should be done before core application is initialised. This is handled correctly in widgets part but not in qml part. Unify our shared context creation and call WebEngine::initialize() before QCoreaApplication is created. Context has to be set shared before first window's QPlatformOpenGLContext is created and not before window itself is created as documentation claimed. Keep the older code running, but print the warning. Update one test to test new initialization order, but keep the others to check if they still works. [ChangeLog] WebEngine::initialize() has to be called before QCoreApplication is created. Task-number: QTBUG-76391 Change-Id: Iff938493a4d21f360110136192daedb6199584c1 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'examples/webengine/recipebrowser')
-rw-r--r--examples/webengine/recipebrowser/main.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/examples/webengine/recipebrowser/main.cpp b/examples/webengine/recipebrowser/main.cpp
index 6e6d69804..e61b9e0f5 100644
--- a/examples/webengine/recipebrowser/main.cpp
+++ b/examples/webengine/recipebrowser/main.cpp
@@ -58,9 +58,10 @@ int main(int argc, char *argv[])
{
QCoreApplication::setOrganizationName("QtExamples");
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
- QGuiApplication app(argc, argv);
QtWebEngine::initialize();
+ QGuiApplication app(argc, argv);
+
QQuickStyle::setStyle(QStringLiteral("Material"));
QQmlApplicationEngine engine;