summaryrefslogtreecommitdiff
path: root/examples/qt3d/wave/Background.qml
diff options
context:
space:
mode:
authorKevin Ottens <kevin.ottens@kdab.com>2016-05-04 12:23:32 +0200
committerSean Harmer <sean.harmer@kdab.com>2016-05-04 15:32:52 +0000
commit7fa8b1523a0791a159c594687c89af7ae621752a (patch)
tree37d514632251ca22ba9713226a877de88ea2e663 /examples/qt3d/wave/Background.qml
parent2339fb571f1ca2e5d9057cccbb5989841c524dea (diff)
downloadqt3d-7fa8b1523a0791a159c594687c89af7ae621752a.tar.gz
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 <sean.harmer@kdab.com>
Diffstat (limited to 'examples/qt3d/wave/Background.qml')
-rw-r--r--examples/qt3d/wave/Background.qml43
1 files changed, 21 insertions, 22 deletions
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 ) }
+ ]
+ }
}