diff options
author | Leonardo Sobral Cunha <leo.cunha@nokia.com> | 2010-02-26 07:02:43 (GMT) |
---|---|---|
committer | Leonardo Sobral Cunha <leo.cunha@nokia.com> | 2010-02-26 07:11:16 (GMT) |
commit | 543c4b82e6d6cc4a396b1c105d7321643b6ef4c6 (patch) | |
tree | 86fb3178533497e154a6ac601fd19ea03a3daee0 /src | |
parent | e179dafbac29e50886331b2dfb262c3874bb0a71 (diff) | |
download | Qt-543c4b82e6d6cc4a396b1c105d7321643b6ef4c6.zip Qt-543c4b82e6d6cc4a396b1c105d7321643b6ef4c6.tar.gz Qt-543c4b82e6d6cc4a396b1c105d7321643b6ef4c6.tar.bz2 |
Revert "Some animation cleanup/refactoring."
This reverts commit b5700759da7bccf0ccd6e20b1727950532894ad2.
Diffstat (limited to 'src')
-rw-r--r-- | src/declarative/util/qdeclarativeanimation.cpp | 11 | ||||
-rw-r--r-- | src/declarative/util/qdeclarativeanimation_p_p.h | 21 |
2 files changed, 12 insertions, 20 deletions
diff --git a/src/declarative/util/qdeclarativeanimation.cpp b/src/declarative/util/qdeclarativeanimation.cpp index 328f0e4..181ef0a 100644 --- a/src/declarative/util/qdeclarativeanimation.cpp +++ b/src/declarative/util/qdeclarativeanimation.cpp @@ -1572,8 +1572,7 @@ QDeclarativeSequentialAnimation::QDeclarativeSequentialAnimation(QObject *parent QDeclarativeAnimationGroup(parent) { Q_D(QDeclarativeAnimationGroup); - d->ag = new QSequentialAnimationGroup; - QDeclarativeGraphics_setParent_noEvent(d->ag, this); + d->ag = new QSequentialAnimationGroup(this); } QDeclarativeSequentialAnimation::~QDeclarativeSequentialAnimation() @@ -1638,8 +1637,7 @@ QDeclarativeParallelAnimation::QDeclarativeParallelAnimation(QObject *parent) : QDeclarativeAnimationGroup(parent) { Q_D(QDeclarativeAnimationGroup); - d->ag = new QParallelAnimationGroup; - QDeclarativeGraphics_setParent_noEvent(d->ag, this); + d->ag = new QParallelAnimationGroup(this); } QDeclarativeParallelAnimation::~QDeclarativeParallelAnimation() @@ -1798,7 +1796,7 @@ QDeclarativePropertyAnimation::~QDeclarativePropertyAnimation() void QDeclarativePropertyAnimationPrivate::init() { Q_Q(QDeclarativePropertyAnimation); - va = new QDeclarativeBulkValueAnimator; + va = new QDeclarativeTimeLineValueAnimator; QDeclarativeGraphics_setParent_noEvent(va, q); } @@ -2214,7 +2212,7 @@ QAbstractAnimation *QDeclarativePropertyAnimation::qtAnimation() return d->va; } -struct PropertyUpdater : public QDeclarativeBulkValueUpdater +struct PropertyUpdater : public QDeclarativeTimeLineValue { QDeclarativeStateActions actions; int interpolatorType; //for Number/ColorAnimation @@ -2232,6 +2230,7 @@ struct PropertyUpdater : public QDeclarativeBulkValueUpdater wasDeleted = &deleted; if (reverse) //QVariantAnimation sends us 1->0 when reversed, but we are expecting 0->1 v = 1 - v; + QDeclarativeTimeLineValue::setValue(v); for (int ii = 0; ii < actions.count(); ++ii) { QDeclarativeAction &action = actions[ii]; diff --git a/src/declarative/util/qdeclarativeanimation_p_p.h b/src/declarative/util/qdeclarativeanimation_p_p.h index ae82a90..e582066 100644 --- a/src/declarative/util/qdeclarativeanimation_p_p.h +++ b/src/declarative/util/qdeclarativeanimation_p_p.h @@ -149,21 +149,14 @@ private: bool running; }; -class QDeclarativeBulkValueUpdater -{ -public: - virtual ~QDeclarativeBulkValueUpdater() {} - virtual void setValue(qreal value) = 0; -}; - -//animates QDeclarativeBulkValueUpdater (assumes start and end values will be reals or compatible) -class QDeclarativeBulkValueAnimator : public QVariantAnimation +//animates QDeclarativeTimeLineValue (assumes start and end values will be reals or compatible) +class QDeclarativeTimeLineValueAnimator : public QVariantAnimation { Q_OBJECT public: - QDeclarativeBulkValueAnimator(QObject *parent = 0) : QVariantAnimation(parent), animValue(0), fromSourced(0), policy(KeepWhenStopped) {} - ~QDeclarativeBulkValueAnimator() { if (policy == DeleteWhenStopped) { delete animValue; animValue = 0; } } - void setAnimValue(QDeclarativeBulkValueUpdater *value, DeletionPolicy p) + QDeclarativeTimeLineValueAnimator(QObject *parent = 0) : QVariantAnimation(parent), animValue(0), fromSourced(0), policy(KeepWhenStopped) {} + ~QDeclarativeTimeLineValueAnimator() { if (policy == DeleteWhenStopped) { delete animValue; animValue = 0; } } + void setAnimValue(QDeclarativeTimeLineValue *value, DeletionPolicy p) { if (state() == Running) stop(); @@ -200,7 +193,7 @@ protected: } private: - QDeclarativeBulkValueUpdater *animValue; + QDeclarativeTimeLineValue *animValue; bool *fromSourced; DeletionPolicy policy; }; @@ -359,7 +352,7 @@ public: int interpolatorType; QVariantAnimation::Interpolator interpolator; - QDeclarativeBulkValueAnimator *va; + QDeclarativeTimeLineValueAnimator *va; static QVariant interpolateVariant(const QVariant &from, const QVariant &to, qreal progress); static void convertVariant(QVariant &variant, int type); |