From 43548effc00079adba91ca25456060c5fb976d5f Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Thu, 25 Aug 2016 13:55:46 +0300 Subject: Fix qmlcustomizations example If the interval coefficient was under 0.25, it resulted as zero interval for the timer, stopping the animation. The blinking after animation stopped was also broken, as using var as a temporary color store doesn't work due to var assignments being by reference. Using a separate color property instead of var works around this issue. Task-number: QTRD-2170 Change-Id: I7224ff259a076da3c6e5e6e66bc0c3031aa1dda6 Reviewed-by: Mika Salmela Reviewed-by: Miikka Heikkinen --- examples/charts/qmlcustomizations/qml/qmlcustomizations/main.qml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'examples') diff --git a/examples/charts/qmlcustomizations/qml/qmlcustomizations/main.qml b/examples/charts/qmlcustomizations/qml/qmlcustomizations/main.qml index d10b12c8..391248e6 100644 --- a/examples/charts/qmlcustomizations/qml/qmlcustomizations/main.qml +++ b/examples/charts/qmlcustomizations/qml/qmlcustomizations/main.qml @@ -61,7 +61,7 @@ Item { //![2] Component.onCompleted: { - __intervalCoefficient = Math.random() + 0.1; + __intervalCoefficient = Math.random() + 0.25; for (var i = 0; i < 20; i++) wheelOfFortune.append("", 1); @@ -77,6 +77,8 @@ Item { //![2] Timer { + id: timer + property color switchColor triggeredOnStart: true running: true repeat: true @@ -101,9 +103,9 @@ Item { //![5] // Switch the colors of the slice and the border wheelOfFortune.at(index).borderWidth = 2; - var borderColor = wheelOfFortune.at(index).borderColor; + switchColor = wheelOfFortune.at(index).borderColor; wheelOfFortune.at(index).borderColor = wheelOfFortune.at(index).color; - wheelOfFortune.at(index).color = borderColor; + wheelOfFortune.at(index).color = switchColor; //![5] } } -- cgit v1.2.3