From bb494edf4bf3ccfcf7f0276554f45d18cdd3a5cb Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Mon, 2 May 2016 11:15:51 +0200 Subject: Fix QtWebEngineCore::initialize() for Qt < 5.6.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In Qt versions < 5.6.1 the constructor of QCoreApplication directly calls QCoreApplication::init and QtWebEngineCore::initialize() in turn. That means that qobject_cast cannot work, because the object is not fully constructed yet. This was fixed for Qt 5.6.1 in commit qtbase/1b441c39. This patch turns off the fix for QTBUG-51789 when building QtWebEngine against Qt versions older than 5.6.1. Task-number: QTBUG-51789 Change-Id: I092fb559ea4449bd443737d5962b4b87dee88cdd Reviewed-by: Michael BrĂ¼ning --- src/core/api/qtwebenginecoreglobal.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/core/api/qtwebenginecoreglobal.cpp b/src/core/api/qtwebenginecoreglobal.cpp index e60e6139e..f4edae0e6 100644 --- a/src/core/api/qtwebenginecoreglobal.cpp +++ b/src/core/api/qtwebenginecoreglobal.cpp @@ -76,9 +76,11 @@ QWEBENGINE_PRIVATE_EXPORT void initialize() return; } +#if (QT_VERSION >= QT_VERSION_CHECK(5, 6, 1)) // Bail out silently if the user did not construct a QGuiApplication. if (!qobject_cast(app)) return; +#endif if (app->thread() != QThread::currentThread()) { qFatal("QtWebEngine::initialize() must be called from the Qt gui thread."); -- cgit v1.2.3