summaryrefslogtreecommitdiffstats
path: root/src/corelib/animation/qvariantanimation.cpp
diff options
context:
space:
mode:
authorThierry Bastian <thierry.bastian@nokia.com>2009-05-26 09:36:16 (GMT)
committerThierry Bastian <thierry.bastian@nokia.com>2009-05-26 09:37:50 (GMT)
commit5345306c9a0a3b10dbf640253b8b2287c762b081 (patch)
treebdebbe963564f9dbbe30846a4f177d30f2e7ee51 /src/corelib/animation/qvariantanimation.cpp
parent7733f81af953a1ddaa7debc12bb29b101c5bc101 (diff)
downloadQt-5345306c9a0a3b10dbf640253b8b2287c762b081.zip
Qt-5345306c9a0a3b10dbf640253b8b2287c762b081.tar.gz
Qt-5345306c9a0a3b10dbf640253b8b2287c762b081.tar.bz2
Fixed a bug in animation when you set a start value that doesn't have
the same type as the property For example, if you set a start value of 0 (integer) for a qreal animation, it would not work. Reviewed-by: janarve
Diffstat (limited to 'src/corelib/animation/qvariantanimation.cpp')
-rw-r--r--src/corelib/animation/qvariantanimation.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/corelib/animation/qvariantanimation.cpp b/src/corelib/animation/qvariantanimation.cpp
index 4542a86..239add9 100644
--- a/src/corelib/animation/qvariantanimation.cpp
+++ b/src/corelib/animation/qvariantanimation.cpp
@@ -179,10 +179,14 @@ void QVariantAnimationPrivate::convertValues(int t)
//this ensures that all the keyValues are of type t
for (int i = 0; i < keyValues.count(); ++i) {
QVariantAnimation::KeyValue &pair = keyValues[i];
- if (pair.second.userType() != t)
- pair.second.convert(static_cast<QVariant::Type>(t));
+ pair.second.convert(static_cast<QVariant::Type>(t));
}
- interpolator = 0; // if the type changed we need to update the interpolator
+ //we also need update to the current interval if needed
+ currentInterval.start.second.convert(static_cast<QVariant::Type>(t));
+ currentInterval.end.second.convert(static_cast<QVariant::Type>(t));
+
+ //... and the interpolator
+ interpolator = 0;
}
/*!