summaryrefslogtreecommitdiffstats
path: root/src/corelib
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-21 15:29:44 (GMT)
commitce482e1495c12e531781eb5ad0a20a0c0292f853 (patch)
tree3b2d54d68ed9d6d5753f1971cb11363a7f7d1d53 /src/corelib
parent04ce953e61acf5a73826b6207cf8bf2cdfce8f92 (diff)
downloadQt-ce482e1495c12e531781eb5ad0a20a0c0292f853.zip
Qt-ce482e1495c12e531781eb5ad0a20a0c0292f853.tar.gz
Qt-ce482e1495c12e531781eb5ad0a20a0c0292f853.tar.bz2
QPropertyAnimation reevaluates the default start value after each run
When the start value is not explicitly defined, the property animation will set the default start to be the current property value when updating the animation's state to Running. Reviewed-by: Jan-Arve
Diffstat (limited to 'src/corelib')
-rw-r--r--src/corelib/animation/qpropertyanimation.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/corelib/animation/qpropertyanimation.cpp b/src/corelib/animation/qpropertyanimation.cpp
index adf3527..edcabaa 100644
--- a/src/corelib/animation/qpropertyanimation.cpp
+++ b/src/corelib/animation/qpropertyanimation.cpp
@@ -233,14 +233,16 @@ void QPropertyAnimation::updateState(QAbstractAnimation::State oldState,
d->updateMetaProperty();
QPropertyAnimation *oldAnim = hash->value(key, 0);
if (oldAnim) {
- //we try to stop the top level group
+ // try to stop the top level group
QAbstractAnimation *current = oldAnim;
while(current->group() && current->state() != Stopped) current = current->group();
current->stop();
}
hash->insert(key, this);
// Initialize start value
- if (d->target && !d->defaultStartValue.isValid() && (d->atBeginning() || d->atEnd())) {
+ // ### review this line below, d->atEnd() ?
+ // ### avoid entering a state where start value is not set
+ if (d->target && (d->atBeginning() || d->atEnd())) {
d->setDefaultStartValue(d->target->property(d->propertyName.constData()));
}
} else if (hash->value(key) == this) {