diff options
author | Alan Alpert <alan.alpert@nokia.com> | 2012-03-27 18:00:33 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-03-28 05:49:28 +0200 |
commit | a3d4c97c5fb28599e007116fec679b16656df512 (patch) | |
tree | 811ae05f13d2b90dce878346ae2452dcf6b3934d /examples/quick | |
parent | ed37dd9bb1f63d47a5daafc06af3a13549000f0c (diff) |
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 <yann.bodson@nokia.com>
Diffstat (limited to 'examples/quick')
-rw-r--r-- | examples/quick/shadereffects/shadereffects.qml | 11 |
1 files changed, 6 insertions, 5 deletions
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; |