summaryrefslogtreecommitdiffstats
path: root/src/webenginewidgets
diff options
context:
space:
mode:
Diffstat (limited to 'src/webenginewidgets')
-rw-r--r--src/webenginewidgets/api/qtwebenginewidgetsglobal.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/webenginewidgets/api/qtwebenginewidgetsglobal.cpp b/src/webenginewidgets/api/qtwebenginewidgetsglobal.cpp
index 1ef6386ad..263376e45 100644
--- a/src/webenginewidgets/api/qtwebenginewidgetsglobal.cpp
+++ b/src/webenginewidgets/api/qtwebenginewidgetsglobal.cpp
@@ -36,7 +36,7 @@
#include "qtwebenginewidgetsglobal.h"
-#include <QCoreApplication>
+#include <QGuiApplication>
namespace QtWebEngineCore
{
@@ -46,6 +46,10 @@ namespace QtWebEngineCore
QT_BEGIN_NAMESPACE
static void initialize()
{
+ // Bail out silently if the user did not construct a QGuiApplication.
+ if (!qobject_cast<QGuiApplication *>(QCoreApplication::instance()))
+ return;
+
QtWebEngineCore::initialize();
}