From 7fa8b1523a0791a159c594687c89af7ae621752a Mon Sep 17 00:00:00 2001 From: Kevin Ottens Date: Wed, 4 May 2016 12:23:32 +0200 Subject: Get rid of QLayer::names Don't reinvent a variable naming system (string based global variables even) and instead use pointer to QLayer instance everywhere, even with QLayerFilter. The wave and deferred-renderer-cpp examples have been ported to the new API. Change-Id: I82a858770954a8743a5c3d2ce0c463e62844871f Task-number: QTBUG-51440 Reviewed-by: Sean Harmer --- examples/qt3d/wave/Background.qml | 43 +++++++++++++++++++-------------------- 1 file changed, 21 insertions(+), 22 deletions(-) (limited to 'examples/qt3d/wave/Background.qml') diff --git a/examples/qt3d/wave/Background.qml b/examples/qt3d/wave/Background.qml index 8b81770b9..6937026d6 100644 --- a/examples/qt3d/wave/Background.qml +++ b/examples/qt3d/wave/Background.qml @@ -57,6 +57,7 @@ Entity { id: root property real hue: 0.0 property alias animateColors: hueAnim.running + property Layer layer: null QQ2.NumberAnimation { id: hueAnim @@ -74,29 +75,27 @@ Entity { property color color2: Qt.hsla( (hue + 0.59) % 1, 1.0, 0.15 ) } - components: [ - Layer { - names: "background" - }, + components: [ layer, mesh, transform, material ] - PlaneMesh { - width: 2.0 - height: 2.0 - meshResolution: Qt.size( 2, 2 ) - }, - - Transform { - // Rotate the plane so that it faces us - rotation: fromAxisAndAngle(Qt.vector3d(1, 0, 0), 90) - }, + PlaneMesh { + id: mesh + width: 2.0 + height: 2.0 + meshResolution: Qt.size( 2, 2 ) + } - Material { - effect: BackgroundEffect {} - parameters: [ - Parameter { name: "color1"; value: Qt.vector3d( _private.color1.r, _private.color1.g, _private.color1.b ) }, - Parameter { name: "color2"; value: Qt.vector3d( _private.color2.r, _private.color2.g, _private.color2.b ) } - ] - } - ] + Transform { + id: transform + // Rotate the plane so that it faces us + rotation: fromAxisAndAngle(Qt.vector3d(1, 0, 0), 90) + } + Material { + id: material + effect: BackgroundEffect {} + parameters: [ + Parameter { name: "color1"; value: Qt.vector3d( _private.color1.r, _private.color1.g, _private.color1.b ) }, + Parameter { name: "color2"; value: Qt.vector3d( _private.color2.r, _private.color2.g, _private.color2.b ) } + ] + } } -- cgit v1.2.1