diff options
author | David Boddie <dboddie@trolltech.com> | 2009-04-29 16:21:22 (GMT) |
---|---|---|
committer | David Boddie <dboddie@trolltech.com> | 2009-04-29 16:21:22 (GMT) |
commit | b467246eb63ec649ad2348ac9b6886ee20dfc033 (patch) | |
tree | fec30c5af0fbabedffaa9abbf576dfa349e2cb22 /src/corelib/animation | |
parent | c07b3bd9c3c2d7195dfa52547961647a963c8d41 (diff) | |
parent | bfc92cacbeeb2d1a5ca39e31ccdb94f9674bd547 (diff) | |
download | Qt-b467246eb63ec649ad2348ac9b6886ee20dfc033.zip Qt-b467246eb63ec649ad2348ac9b6886ee20dfc033.tar.gz Qt-b467246eb63ec649ad2348ac9b6886ee20dfc033.tar.bz2 |
Merge branch 'kinetic-animations' of git@scm.dev.nokia.troll.no:qt/kinetic into kinetic-animations
Diffstat (limited to 'src/corelib/animation')
-rw-r--r-- | src/corelib/animation/qvariantanimation.cpp | 24 |
1 files changed, 7 insertions, 17 deletions
diff --git a/src/corelib/animation/qvariantanimation.cpp b/src/corelib/animation/qvariantanimation.cpp index 9f8cbf0..bb6cf1c 100644 --- a/src/corelib/animation/qvariantanimation.cpp +++ b/src/corelib/animation/qvariantanimation.cpp @@ -175,26 +175,16 @@ void QVariantAnimationPrivate::updateCurrentValue() endProgress = currentInterval.end.first; const qreal localProgress = (progress - startProgress) / (endProgress - startProgress); - bool changed = false; - { - //we do that here in a limited scope so that ret is dereferenced and frees memory - //and the call to updateCurrentValue can recreate QVariant of the same type (for ex. in - //QGraphicsItem::setPos - QVariant ret = q->interpolated(currentInterval.start.second, - currentInterval.end.second, - localProgress); - if (currentValue != ret) { - changed = true; - qSwap(currentValue, ret); - } - } - - if (changed) { - //the value has changed - q->updateCurrentValue(currentValue); + QVariant ret = q->interpolated(currentInterval.start.second, + currentInterval.end.second, + localProgress); + qSwap(currentValue, ret); + q->updateCurrentValue(currentValue); #ifndef QT_EXPERIMENTAL_SOLUTION if (connectedSignals & changedSignalMask) #endif + if (currentValue != ret) { + //the value has changed emit q->valueChanged(currentValue); } } |