diff options
author | Michael Brasser <michael.brasser@nokia.com> | 2010-02-16 01:59:27 (GMT) |
---|---|---|
committer | Michael Brasser <michael.brasser@nokia.com> | 2010-02-18 05:17:13 (GMT) |
commit | ad2b2c698d90d04aebe1f6d05c3a4eb992c0e7b6 (patch) | |
tree | 144a7a8f3208d9388b8666d26aa0a231b325b87f /src/declarative/util/qmlanimation_p_p.h | |
parent | 635b329592f26d64eeb6212b6056249b15293dcf (diff) | |
download | Qt-ad2b2c698d90d04aebe1f6d05c3a4eb992c0e7b6.zip Qt-ad2b2c698d90d04aebe1f6d05c3a4eb992c0e7b6.tar.gz Qt-ad2b2c698d90d04aebe1f6d05c3a4eb992c0e7b6.tar.bz2 |
Get rid of the matchProperties/properties distinction, as it
has proven to be confusing in practice.
property/target and properties/targets will be functionally equivilant
(the only distinction being singular/plural). In a transition these
properties can be used for both 'matching' and explicit animation
based on whether a 'to' value is supplied.
The documentation, tests, examples and demos have been updated as well.
Diffstat (limited to 'src/declarative/util/qmlanimation_p_p.h')
-rw-r--r-- | src/declarative/util/qmlanimation_p_p.h | 24 |
1 files changed, 9 insertions, 15 deletions
diff --git a/src/declarative/util/qmlanimation_p_p.h b/src/declarative/util/qmlanimation_p_p.h index d680194..2dc59f9 100644 --- a/src/declarative/util/qmlanimation_p_p.h +++ b/src/declarative/util/qmlanimation_p_p.h @@ -151,6 +151,8 @@ public: { if (state() == Running) stop(); + if (policy == DeleteWhenStopped) + delete animValue; animValue = value; policy = p; } @@ -165,16 +167,17 @@ protected: animValue->setValue(value.toReal()); } virtual void updateState(State newState, State oldState) - { + { QVariantAnimation::updateState(newState, oldState); if (newState == Running) { //check for new from every loop if (fromSourced) *fromSourced = false; - } else if (newState == Stopped && policy == DeleteWhenStopped) { + } /*else if (newState == Stopped && policy == DeleteWhenStopped) { delete animValue; animValue = 0; - } + }*/ //### we get a stop each loop if we are in a group + //### top-level animation is the only reliable one for this } private: @@ -265,7 +268,7 @@ class QmlPropertyActionPrivate : public QmlAbstractAnimationPrivate Q_DECLARE_PUBLIC(QmlPropertyAction) public: QmlPropertyActionPrivate() - : QmlAbstractAnimationPrivate(), target(0), proxy(this), spa(0) {} + : QmlAbstractAnimationPrivate(), target(0), spa(0) {} void init(); @@ -277,10 +280,6 @@ public: QmlNullableValue<QVariant> value; - void doAction(); - - QAnimationActionProxy<QmlPropertyActionPrivate, - &QmlPropertyActionPrivate::doAction> proxy; QActionAnimation *spa; }; @@ -289,12 +288,11 @@ class QmlParentActionPrivate : public QmlAbstractAnimationPrivate Q_DECLARE_PUBLIC(QmlParentAction) public: QmlParentActionPrivate() - : QmlAbstractAnimationPrivate(), pcTarget(0), pcMatchTarget(0), pcParent(0) {} + : QmlAbstractAnimationPrivate(), pcTarget(0), pcParent(0) {} void init(); QmlGraphicsItem *pcTarget; - QmlGraphicsItem *pcMatchTarget; QmlGraphicsItem *pcParent; void doAction(); @@ -346,8 +344,7 @@ class QmlPropertyAnimationPrivate : public QmlAbstractAnimationPrivate public: QmlPropertyAnimationPrivate() : QmlAbstractAnimationPrivate(), target(0), fromSourced(false), fromIsDefined(false), toIsDefined(false), - rangeIsSet(false), defaultToInterpolatorType(0), interpolatorType(0), interpolator(0), va(0), - value(this, &QmlPropertyAnimationPrivate::valueChanged) {} + rangeIsSet(false), defaultToInterpolatorType(0), interpolatorType(0), interpolator(0), va(0) {} void init(); @@ -371,9 +368,6 @@ public: QVariantAnimation::Interpolator interpolator; QmlTimeLineValueAnimator *va; - virtual void valueChanged(qreal); - - QmlTimeLineValueProxy<QmlPropertyAnimationPrivate> value; static QVariant interpolateVariant(const QVariant &from, const QVariant &to, qreal progress); static void convertVariant(QVariant &variant, int type); |