summaryrefslogtreecommitdiffstats
path: root/tests/auto/qpropertyanimation
diff options
context:
space:
mode:
authorLeonardo Sobral Cunha <leo.cunha@nokia.com>2009-04-21 13:39:37 (GMT)
committerLeonardo Sobral Cunha <leo.cunha@nokia.com>2009-04-22 15:50:40 (GMT)
commitebda84cd06faaf440a096bda7966fa795ca86318 (patch)
treed50c19f9c3cd5b56e857aa35da788244fafdc4c7 /tests/auto/qpropertyanimation
parent6504e06561b9127eb6179b5a5deb8f6cd1fff491 (diff)
downloadQt-ebda84cd06faaf440a096bda7966fa795ca86318.zip
Qt-ebda84cd06faaf440a096bda7966fa795ca86318.tar.gz
Qt-ebda84cd06faaf440a096bda7966fa795ca86318.tar.bz2
Fixes QPropertyAnimation's default start value update condition
The default start value is updated when the animation changes from Stopped to Running state. Reviewed-by: Jan-Arve
Diffstat (limited to 'tests/auto/qpropertyanimation')
-rw-r--r--tests/auto/qpropertyanimation/tst_qpropertyanimation.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/auto/qpropertyanimation/tst_qpropertyanimation.cpp b/tests/auto/qpropertyanimation/tst_qpropertyanimation.cpp
index 437c862..f0deab5 100644
--- a/tests/auto/qpropertyanimation/tst_qpropertyanimation.cpp
+++ b/tests/auto/qpropertyanimation/tst_qpropertyanimation.cpp
@@ -84,6 +84,7 @@ private slots:
void deletion3();
void duration0();
void noStartValue();
+ void noStartValueWithLoop();
void startWhenAnotherIsRunning();
void easingcurve_data();
void easingcurve();
@@ -416,6 +417,27 @@ void tst_QPropertyAnimation::noStartValue()
QCOMPARE(o.values.last(), 420);
}
+void tst_QPropertyAnimation::noStartValueWithLoop()
+{
+ StartValueTester o;
+ o.setProperty("ole", 42);
+ o.values.clear();
+
+ QPropertyAnimation a(&o, "ole");
+ a.setEndValue(420);
+ a.setDuration(250);
+ a.setLoopCount(2);
+ a.start();
+
+ a.setCurrentTime(250);
+ QCOMPARE(o.values.first(), 42);
+ QCOMPARE(a.currentValue().toInt(), 42);
+ QCOMPARE(o.values.last(), 42);
+
+ a.setCurrentTime(500);
+ QCOMPARE(a.currentValue().toInt(), 420);
+}
+
void tst_QPropertyAnimation::startWhenAnotherIsRunning()
{
StartValueTester o;