From f5e77e9481ed32564d6692f317dbc387b5b464ce Mon Sep 17 00:00:00 2001
From: Jocelyn Turcotte <jocelyn.turcotte@digia.com>
Date: Tue, 1 Jul 2014 18:24:39 +0200
Subject: [PATCH] Drop 5.2 support

We actually already depend on dev (5.4) in other areas.

Change-Id: Iab297a51ab06209a96f11f97c74463d38203eda8
Reviewed-by: Andras Becsi <andras.becsi@digia.com>
---
 examples/examples.pro                   | 2 +-
 src/core/content_browser_client_qt.cpp  | 5 -----
 src/src.pro                             | 2 +-
 src/webengine/api/qtwebengineglobal.cpp | 5 -----
 tests/auto/auto.pro                     | 2 +-
 5 files changed, 3 insertions(+), 13 deletions(-)

diff --git a/examples/examples.pro b/examples/examples.pro
index 253d2ff5b..45621622c 100644
--- a/examples/examples.pro
+++ b/examples/examples.pro
@@ -2,7 +2,7 @@ TEMPLATE=subdirs
 
 SUBDIRS += webengine/quicknanobrowser
 
-qtHaveModule(webenginewidgets):equals(QT_MAJOR_VERSION, 5):greaterThan(QT_MINOR_VERSION, 2) {
+qtHaveModule(webenginewidgets) {
     SUBDIRS += \
         webenginewidgets/browser \
         webenginewidgets/fancybrowser
diff --git a/src/core/content_browser_client_qt.cpp b/src/core/content_browser_client_qt.cpp
index c70b2993e..641d05011 100644
--- a/src/core/content_browser_client_qt.cpp
+++ b/src/core/content_browser_client_qt.cpp
@@ -63,7 +63,6 @@
 
 #include <QGuiApplication>
 #include <QtGui/private/qopenglcontext_p.h>
-#include <QtQuick/private/qsgcontext_p.h>
 #include <qpa/qplatformnativeinterface.h>
 
 namespace {
@@ -262,11 +261,7 @@ private:
 void ShareGroupQtQuick::AboutToAddFirstContext()
 {
     // This currently has to be setup by ::main in all applications using QQuickWebEngineView with delegated rendering.
-#if (QT_VERSION < QT_VERSION_CHECK(5, 3, 0))
-    QOpenGLContext *shareContext = QSGContext::sharedOpenGLContext();
-#else
     QOpenGLContext *shareContext = QOpenGLContextPrivate::globalShareContext();
-#endif
     if (!shareContext) {
         qFatal("QWebEngine: OpenGL resource sharing is not set up in QtQuick. Please make sure to call QWebEngine::initialize() or QWebEngineWidgets::initialize() in your main() function.");
     }
diff --git a/src/src.pro b/src/src.pro
index 6d902497f..ed402c582 100644
--- a/src/src.pro
+++ b/src/src.pro
@@ -21,6 +21,6 @@ SUBDIRS += core \
 # Another example of where this could be necessary is to make it easy to build proprietery codecs support.
 !contains(WEBENGINE_CONFIG, no_ui_delegates): SUBDIRS += webengine/ui
 
-qtHaveModule(widgets):equals(QT_MAJOR_VERSION, 5):greaterThan(QT_MINOR_VERSION, 2) {
+qtHaveModule(widgets) {
     SUBDIRS += webenginewidgets
 }
diff --git a/src/webengine/api/qtwebengineglobal.cpp b/src/webengine/api/qtwebengineglobal.cpp
index 7340d32d1..0a1d6a449 100644
--- a/src/webengine/api/qtwebengineglobal.cpp
+++ b/src/webengine/api/qtwebengineglobal.cpp
@@ -44,7 +44,6 @@
 #include <QGuiApplication>
 #include <QThread>
 #include <private/qopenglcontext_p.h>
-#include <private/qsgcontext_p.h>
 
 static QOpenGLContext *shareContext;
 
@@ -72,10 +71,6 @@ void QWebEngine::initialize()
     shareContext = new QOpenGLContext;
     shareContext->create();
     qAddPostRoutine(deleteShareContext);
-#if (QT_VERSION < QT_VERSION_CHECK(5, 3, 0))
-    QSGContext::setSharedOpenGLContext(shareContext);
-#else
     QOpenGLContextPrivate::setGlobalShareContext(shareContext);
-#endif
 }
 
diff --git a/tests/auto/auto.pro b/tests/auto/auto.pro
index 4c59f400b..f14305f72 100644
--- a/tests/auto/auto.pro
+++ b/tests/auto/auto.pro
@@ -2,6 +2,6 @@ TEMPLATE = subdirs
 
 SUBDIRS = quick
 
-qtHaveModule(webenginewidgets):equals(QT_MAJOR_VERSION, 5):greaterThan(QT_MINOR_VERSION, 2) {
+qtHaveModule(webenginewidgets) {
     SUBDIRS += widgets
 }
-- 
GitLab