From a3d4c97c5fb28599e007116fec679b16656df512 Mon Sep 17 00:00:00 2001 From: Alan Alpert Date: Tue, 27 Mar 2012 18:00:33 +1000 Subject: Reduce assumptions in examples -dynamic scene, don't set duration on running animation (doesn't work) -dynamic scene, just use set colors instead of system palette (in case platform doesn't support it right, like N900) -dynamic scene, calculator and shadereffects, don't rely on root item being automatically in scope (possibly confusing) Change-Id: I1eec018d5387424dc6b07bf51c1b2184b3048553 Reviewed-by: Yann Bodson --- examples/quick/shadereffects/shadereffects.qml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'examples/quick') diff --git a/examples/quick/shadereffects/shadereffects.qml b/examples/quick/shadereffects/shadereffects.qml index b76c960a8f..25efa5f4ed 100644 --- a/examples/quick/shadereffects/shadereffects.qml +++ b/examples/quick/shadereffects/shadereffects.qml @@ -43,6 +43,7 @@ import QtQuick 2.0 import "content" Rectangle { + id: root width: 320 height: 480 /*! @@ -56,10 +57,10 @@ Rectangle { */ property color col: "lightsteelblue" gradient: Gradient { - GradientStop { position: 0.0; color: Qt.tint(col, "#20FFFFFF") } - GradientStop { position: 0.1; color: Qt.tint(col, "#20AAAAAA") } - GradientStop { position: 0.9; color: Qt.tint(col, "#20666666") } - GradientStop { position: 1.0; color: Qt.tint(col, "#20000000") } + GradientStop { position: 0.0; color: Qt.tint(root.col, "#20FFFFFF") } + GradientStop { position: 0.1; color: Qt.tint(root.col, "#20AAAAAA") } + GradientStop { position: 0.9; color: Qt.tint(root.col, "#20666666") } + GradientStop { position: 1.0; color: Qt.tint(root.col, "#20000000") } } ShaderEffectSource { @@ -241,7 +242,7 @@ Rectangle { width: 160 height: 160 property variant source: theSource - property color tint: sliderToColor(colorizeSlider.value) + property color tint: root.sliderToColor(colorizeSlider.value) fragmentShader: " uniform sampler2D source; uniform lowp vec4 tint; -- cgit v1.2.3