summaryrefslogtreecommitdiffstats
path: root/src/declarative/util
diff options
context:
space:
mode:
authorMichael Brasser <michael.brasser@nokia.com>2009-06-26 01:10:56 (GMT)
committerMichael Brasser <michael.brasser@nokia.com>2009-06-26 01:10:56 (GMT)
commit662488175fb9c6a44e9641867177b5396c507891 (patch)
tree554411c26dd635e327198b212d1f6648fec57316 /src/declarative/util
parentbaff8c7e3bba56c3d9c53300ed4524c4b3546c15 (diff)
downloadQt-662488175fb9c6a44e9641867177b5396c507891.zip
Qt-662488175fb9c6a44e9641867177b5396c507891.tar.gz
Qt-662488175fb9c6a44e9641867177b5396c507891.tar.bz2
Fix animation bugs, and add autotest.
Diffstat (limited to 'src/declarative/util')
-rw-r--r--src/declarative/util/qmlanimation.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/declarative/util/qmlanimation.cpp b/src/declarative/util/qmlanimation.cpp
index e42672d..42ed40b 100644
--- a/src/declarative/util/qmlanimation.cpp
+++ b/src/declarative/util/qmlanimation.cpp
@@ -1439,7 +1439,10 @@ QVariant QmlPropertyAnimationPrivate::interpolateVariant(const QVariant &from, c
return QVariant();
QVariantAnimation::Interpolator interpolator = QVariantAnimationPrivate::getInterpolator(from.userType());
- return interpolator(from.constData(), to.constData(), progress);
+ if (interpolator)
+ return interpolator(from.constData(), to.constData(), progress);
+ else
+ return QVariant();
}
//convert a variant from string type to another animatable type
@@ -1851,8 +1854,8 @@ void QmlPropertyAnimation::transition(QmlStateActions &actions,
if (d->toIsDefined)
myAction.toValue = d->to;
- d->convertVariant(myAction.fromValue, (QVariant::Type)(d->interpolatorType ? d->interpolatorType : d->property.propertyType()));
- d->convertVariant(myAction.toValue, (QVariant::Type)(d->interpolatorType ? d->interpolatorType : d->property.propertyType()));
+ d->convertVariant(myAction.fromValue, (QVariant::Type)(d->interpolatorType ? d->interpolatorType : myAction.property.propertyType()));
+ d->convertVariant(myAction.toValue, (QVariant::Type)(d->interpolatorType ? d->interpolatorType : myAction.property.propertyType()));
modified << action.property;
@@ -1868,10 +1871,10 @@ void QmlPropertyAnimation::transition(QmlStateActions &actions,
myAction.property = QmlMetaProperty(obj, props.at(jj));
if (d->fromIsDefined) {
- d->convertVariant(d->from, (QVariant::Type)(d->interpolatorType ? d->interpolatorType : d->property.propertyType()));
+ d->convertVariant(d->from, (QVariant::Type)(d->interpolatorType ? d->interpolatorType : myAction.property.propertyType()));
myAction.fromValue = d->from;
}
- d->convertVariant(d->to, (QVariant::Type)(d->interpolatorType ? d->interpolatorType : d->property.propertyType()));
+ d->convertVariant(d->to, (QVariant::Type)(d->interpolatorType ? d->interpolatorType : myAction.property.propertyType()));
myAction.toValue = d->to;
myAction.bv = 0;
myAction.event = 0;