diff options
author | Thierry Bastian <thierry.bastian@nokia.com> | 2009-12-04 10:50:52 (GMT) |
---|---|---|
committer | Thierry Bastian <thierry.bastian@nokia.com> | 2009-12-04 11:14:21 (GMT) |
commit | ee9aee5d85345880d8269c02cfd3c2d86e89c9d3 (patch) | |
tree | ceefa5b01d9f13ad0efc2a327a89d6a4cbb4f40b /src/declarative | |
parent | 13bafe57db6a94051f45e6d98e58ffc38041d5bc (diff) | |
download | Qt-ee9aee5d85345880d8269c02cfd3c2d86e89c9d3.zip Qt-ee9aee5d85345880d8269c02cfd3c2d86e89c9d3.tar.gz Qt-ee9aee5d85345880d8269c02cfd3c2d86e89c9d3.tar.bz2 |
Use QVariant::toReal() instead of QVariant::toDouble()
This avoids conversions from flat to double en embedded.
Diffstat (limited to 'src/declarative')
-rw-r--r-- | src/declarative/util/qmlanimation.cpp | 4 | ||||
-rw-r--r-- | src/declarative/util/qmlanimation_p_p.h | 2 | ||||
-rw-r--r-- | src/declarative/util/qmlspringfollow.cpp | 4 |
3 files changed, 5 insertions, 5 deletions
diff --git a/src/declarative/util/qmlanimation.cpp b/src/declarative/util/qmlanimation.cpp index 0f5a0f0..5886724 100644 --- a/src/declarative/util/qmlanimation.cpp +++ b/src/declarative/util/qmlanimation.cpp @@ -1341,7 +1341,7 @@ QmlNumberAnimation::~QmlNumberAnimation() qreal QmlNumberAnimation::from() const { Q_D(const QmlPropertyAnimation); - return d->from.toDouble(); + return d->from.toReal(); } void QmlNumberAnimation::setFrom(qreal f) @@ -1357,7 +1357,7 @@ void QmlNumberAnimation::setFrom(qreal f) qreal QmlNumberAnimation::to() const { Q_D(const QmlPropertyAnimation); - return d->to.toDouble(); + return d->to.toReal(); } void QmlNumberAnimation::setTo(qreal t) diff --git a/src/declarative/util/qmlanimation_p_p.h b/src/declarative/util/qmlanimation_p_p.h index 0b65c27..71b6caa 100644 --- a/src/declarative/util/qmlanimation_p_p.h +++ b/src/declarative/util/qmlanimation_p_p.h @@ -160,7 +160,7 @@ protected: virtual void updateCurrentValue(const QVariant &value) { if (animValue) - animValue->setValue(value.toDouble()); + animValue->setValue(value.toReal()); } virtual void updateState(State newState, State oldState) { diff --git a/src/declarative/util/qmlspringfollow.cpp b/src/declarative/util/qmlspringfollow.cpp index 29dcf91..764d7f9 100644 --- a/src/declarative/util/qmlspringfollow.cpp +++ b/src/declarative/util/qmlspringfollow.cpp @@ -200,7 +200,7 @@ void QmlSpringFollowPrivate::start() property.write(currentValue); } else if (sourceValue != currentValue && clock.state() != QAbstractAnimation::Running) { lastTime = 0; - currentValue = property.read().toDouble(); + currentValue = property.read().toReal(); clock.start(); // infinity?? emit q->syncChanged(); } @@ -258,7 +258,7 @@ void QmlSpringFollow::setTarget(const QmlMetaProperty &property) { Q_D(QmlSpringFollow); d->property = property; - d->currentValue = property.read().toDouble(); + d->currentValue = property.read().toReal(); } qreal QmlSpringFollow::sourceValue() const |