From 9cda8d4384825bd93b949f31953548beda165ef8 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Fri, 26 Aug 2016 11:51:06 +0200 Subject: Restore ability to build with Qt 5.7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Defines the qtConfig() test for older Qt versions, and fix conflict between two QSGRectangle definitions. Change-Id: Icf4ef2f88d9e98e7aea4e88d777827bf69a4c281 Reviewed-by: Michael BrĂ¼ning --- src/core/render_widget_host_view_qt_delegate.h | 4 +--- .../render_widget_host_view_qt_delegate_quick.cpp | 3 ++- .../render_widget_host_view_qt_delegate_widget.cpp | 3 ++- tools/qmake/mkspecs/features/functions.prf | 15 +++++++++++++++ 4 files changed, 20 insertions(+), 5 deletions(-) diff --git a/src/core/render_widget_host_view_qt_delegate.h b/src/core/render_widget_host_view_qt_delegate.h index 39c972f4b..1e50c8f08 100644 --- a/src/core/render_widget_host_view_qt_delegate.h +++ b/src/core/render_widget_host_view_qt_delegate.h @@ -51,6 +51,7 @@ class QEvent; class QPainter; class QSGLayer; class QSGNode; +class QSGRectangleNode; class QSGTexture; class QVariant; class QWindow; @@ -61,11 +62,8 @@ class QSGImageNode; typedef QSGImageNode QSGInternalImageNode; class QSGSimpleTextureNode; typedef QSGSimpleTextureNode QSGTextureNode; -class QSGSimpleRectNode; -typedef QSGSimpleRectNode QSGRectangleNode; #else class QSGInternalImageNode; -class QSGRectangleNode; class QSGImageNode; typedef QSGImageNode QSGTextureNode; #endif diff --git a/src/webengine/render_widget_host_view_qt_delegate_quick.cpp b/src/webengine/render_widget_host_view_qt_delegate_quick.cpp index c17c6da06..e9b8dea44 100644 --- a/src/webengine/render_widget_host_view_qt_delegate_quick.cpp +++ b/src/webengine/render_widget_host_view_qt_delegate_quick.cpp @@ -206,7 +206,8 @@ QSGRectangleNode *RenderWidgetHostViewQtDelegateQuick::createRectangleNode() #if (QT_VERSION >= QT_VERSION_CHECK(5, 8, 0)) return QQuickItem::window()->createRectangleNode(); #else - return new QSGSimpleRectNode(); + QSGRenderContext *renderContext = QQuickWindowPrivate::get(QQuickItem::window())->context; + return renderContext->sceneGraphContext()->createRectangleNode(); #endif } diff --git a/src/webenginewidgets/render_widget_host_view_qt_delegate_widget.cpp b/src/webenginewidgets/render_widget_host_view_qt_delegate_widget.cpp index c7b825854..9b5d90146 100644 --- a/src/webenginewidgets/render_widget_host_view_qt_delegate_widget.cpp +++ b/src/webenginewidgets/render_widget_host_view_qt_delegate_widget.cpp @@ -259,7 +259,8 @@ QSGRectangleNode *RenderWidgetHostViewQtDelegateWidget::createRectangleNode() #if (QT_VERSION >= QT_VERSION_CHECK(5, 8, 0)) return quickWindow()->createRectangleNode(); #else - return new QSGSimpleRectNode(); + QSGRenderContext *renderContext = QQuickWindowPrivate::get(quickWindow())->context; + return renderContext->sceneGraphContext()->createRectangleNode(); #endif } diff --git a/tools/qmake/mkspecs/features/functions.prf b/tools/qmake/mkspecs/features/functions.prf index 590d521e8..f6d4f676b 100644 --- a/tools/qmake/mkspecs/features/functions.prf +++ b/tools/qmake/mkspecs/features/functions.prf @@ -1,3 +1,18 @@ +defineTest(isQtMinimum) { + !equals(QT_MAJOR_VERSION, $$1): return(false) + count(ARGS, 1, greaterThan) { + lessThan(QT_MINOR_VERSION, $$2): return(false) + } + return(true) +} + +!isQtMinimum(5, 8) { + defineTest(qtConfig) { + contains(QT_CONFIG, $$1): return(true) + return(false) + } +} + defineTest(isPlatformSupported) { linux { !gcc:!clang { -- cgit v1.2.3