summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSamuli Piippo <samuli.piippo@qt.io>2019-12-04 15:42:31 +0200
committerSamuli Piippo <samuli.piippo@qt.io>2019-12-05 06:47:15 +0000
commitdc4c9d051737598e3880b7a8d5c4226020fa020b (patch)
tree5676fccca350a1231317bc6daa11e3c20fcd4b03
parent61e0c9da397573d8ca3c4f7994f73864ba822aac (diff)
Move WebEngine initialization to be earlier
The call must be done before QCoreApplication is created. "QtWebEngine::initialize() called with QCoreApplication object already created and should be call before. This is depreciated and may fail in the future. Change-Id: I93ffaa5d85363e0969977fe45d5a1e829dca4a01 Reviewed-by: Mikko Gronoff <mikko.gronoff@qt.io>
-rw-r--r--src/main.cpp13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/main.cpp b/src/main.cpp
index de98973..9a993b4 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -68,6 +68,12 @@ void displayHelp(const char *appName)
int main(int argc, char **argv)
{
+#if defined(USE_QTWEBENGINE)
+ // This is currently needed by all QtWebEngine applications using the HW accelerated QQuickWebView.
+ // It enables sharing the QOpenGLContext of all QQuickWindows of the application.
+ // We have to do so until we expose public API for it in Qt or choose to enable it by default.
+ QtWebEngine::initialize();
+#endif
QSettings launcherSettings("Qt", "QtLauncher");
qputenv("QT_IM_MODULE", QByteArray("qtvirtualkeyboard"));
@@ -86,13 +92,6 @@ int main(int argc, char **argv)
QApplication app(argc, argv);
app.setApplicationVersion(APPLICATION_VERSION);
-#if defined(USE_QTWEBENGINE)
- // This is currently needed by all QtWebEngine applications using the HW accelerated QQuickWebView.
- // It enables sharing the QOpenGLContext of all QQuickWindows of the application.
- // We have to do so until we expose public API for it in Qt or choose to enable it by default.
- QtWebEngine::initialize();
-#endif
-
QFontDatabase::addApplicationFont(":/qml/fonts/TitilliumWeb-Light.ttf");
QFontDatabase::addApplicationFont(":/qml/fonts/TitilliumWeb-Regular.ttf");
QFontDatabase::addApplicationFont(":/qml/fonts/TitilliumWeb-SemiBold.ttf");