From 485e4965f355d96bd257d754dc28abc75c6be841 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20Br=C3=BCning?= <michael.bruning@digia.com>
Date: Thu, 11 Sep 2014 17:17:11 +0200
Subject: [PATCH] Create a QCoreApplication in QtWebEngineProcess as well.

A QCoreApplication is needed in order to correctly load the
configuration from qt.conf and setup the Qt environment variables
accordingly. This is important to be able to deploy applications.

This patch creates a dummy QCoreApplication in process main to
have the environment setup correctly.

Change-Id: If536b9edf357d5925fee02f2528872101139f87e
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
---
 src/process/main.cpp | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/process/main.cpp b/src/process/main.cpp
index ec523ad9b..c340b1965 100644
--- a/src/process/main.cpp
+++ b/src/process/main.cpp
@@ -36,6 +36,7 @@
 
 #include "process_main.h"
 
+#include <QCoreApplication>
 #include <stdio.h>
 
 #if defined(OS_LINUX)
@@ -147,6 +148,10 @@ int stat64_proxy(const char *path, struct stat64 *buf)
 
 int main(int argc, const char **argv)
 {
+    // QCoreApplication needs a non-const pointer, while the
+    // ContentMain in Chromium needs the pointer to be const.
+    QCoreApplication qtApplication(argc, const_cast<char**>(argv));
+
     return QtWebEngine::processMain(argc, argv);
 }
 
-- 
GitLab