summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@theqtcompany.com>2016-08-26 11:51:06 +0200
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2016-08-28 09:45:57 +0000
commit9cda8d4384825bd93b949f31953548beda165ef8 (patch)
tree2f0edac480d7557c918badb64b07bce7c6447b5a
parent54b7425c356378018c511bd9087f06767d0bc708 (diff)
Restore ability to build with Qt 5.7v5.8.0-alpha1
Defines the qtConfig() test for older Qt versions, and fix conflict between two QSGRectangle definitions. Change-Id: Icf4ef2f88d9e98e7aea4e88d777827bf69a4c281 Reviewed-by: Michael BrĂ¼ning <michael.bruning@qt.io>
-rw-r--r--src/core/render_widget_host_view_qt_delegate.h4
-rw-r--r--src/webengine/render_widget_host_view_qt_delegate_quick.cpp3
-rw-r--r--src/webenginewidgets/render_widget_host_view_qt_delegate_widget.cpp3
-rw-r--r--tools/qmake/mkspecs/features/functions.prf15
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 39c972f4..1e50c8f0 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 c17c6da0..e9b8dea4 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 c7b82585..9b5d9014 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 590d521e..f6d4f676 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 {