From 9616583e19bb642da8f2d2f4305ddef8ee16feb3 Mon Sep 17 00:00:00 2001 From: Leonardo Sobral Cunha Date: Thu, 25 Feb 2010 15:25:41 +1000 Subject: Fix QDeclarativePropertyAnimation to avoid property writes while stopped Avoid changing the value of the property, while the animation is stopped. This was triggered while changing the duration of the animation, while it was stopped. Task-number: QTBUG-8507 Reviewed-by: Michael Brasser --- src/declarative/util/qdeclarativeanimation_p_p.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/declarative/util/qdeclarativeanimation_p_p.h b/src/declarative/util/qdeclarativeanimation_p_p.h index bb81fb3..65c9807 100644 --- a/src/declarative/util/qdeclarativeanimation_p_p.h +++ b/src/declarative/util/qdeclarativeanimation_p_p.h @@ -165,6 +165,9 @@ public: protected: virtual void updateCurrentValue(const QVariant &value) { + if (state() == QAbstractAnimation::Stopped) + return; + if (animValue) animValue->setValue(value.toReal()); } -- cgit v0.12 From d16d34a90d20e326a38b890e3665b3b8656ee414 Mon Sep 17 00:00:00 2001 From: Leonardo Sobral Cunha Date: Thu, 25 Feb 2010 15:51:14 +1000 Subject: Recfactor in declarative snake demo Avoid having 2 'states' that have 'when' conditions that can be 'true' at the same time. --- demos/declarative/snake/snake.qml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/demos/declarative/snake/snake.qml b/demos/declarative/snake/snake.qml index 3bec747..09b6b7f 100644 --- a/demos/declarative/snake/snake.qml +++ b/demos/declarative/snake/snake.qml @@ -172,14 +172,14 @@ Rectangle { states: [ State { name: "starting" - when: startHeartbeatTimer.running; + when: startHeartbeatTimer.running PropertyChanges {target: progressIndicator; width: 200} PropertyChanges {target: title; opacity: 0} PropertyChanges {target: progressBar; opacity: 1} }, State { name: "running" - when: heartbeat.running + when: (heartbeat.running && !startHeartbeatTimer.running) PropertyChanges {target: progressIndicator; width: 200} PropertyChanges {target: title; opacity: 0} PropertyChanges {target: skull; row: 0; column: 0; } -- cgit v0.12