summaryrefslogtreecommitdiffstats
path: root/src/corelib/animation
diff options
context:
space:
mode:
authorDavid Boddie <dboddie@trolltech.com>2009-04-29 16:21:22 (GMT)
committerDavid Boddie <dboddie@trolltech.com>2009-04-29 16:21:22 (GMT)
commitb467246eb63ec649ad2348ac9b6886ee20dfc033 (patch)
treefec30c5af0fbabedffaa9abbf576dfa349e2cb22 /src/corelib/animation
parentc07b3bd9c3c2d7195dfa52547961647a963c8d41 (diff)
parentbfc92cacbeeb2d1a5ca39e31ccdb94f9674bd547 (diff)
downloadQt-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.cpp24
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);
}
}