diff options
author | Michael Brasser <michael.brasser@nokia.com> | 2010-02-22 07:27:11 (GMT) |
---|---|---|
committer | Michael Brasser <michael.brasser@nokia.com> | 2010-02-26 00:27:22 (GMT) |
commit | 3218d437a13ac82f65abcea0db099f54504c8875 (patch) | |
tree | 49e23c5efc60e920ba136f911322694394ae735c /src/declarative/util/qdeclarativeanimation_p.h | |
parent | 61811d9b43828c1cc53c773fd66b78313f4fb942 (diff) | |
download | Qt-3218d437a13ac82f65abcea0db099f54504c8875.zip Qt-3218d437a13ac82f65abcea0db099f54504c8875.tar.gz Qt-3218d437a13ac82f65abcea0db099f54504c8875.tar.bz2 |
Add ParentAnimation.
ParentAnimation will replace ParentAction. It provides two advantages:
* It will animate correctly when reversed.
* It allows reparenting via another item, which is useful in
the presence of clips, for example.
Diffstat (limited to 'src/declarative/util/qdeclarativeanimation_p.h')
-rw-r--r-- | src/declarative/util/qdeclarativeanimation_p.h | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/src/declarative/util/qdeclarativeanimation_p.h b/src/declarative/util/qdeclarativeanimation_p.h index 53afbb5..b57bd9e 100644 --- a/src/declarative/util/qdeclarativeanimation_p.h +++ b/src/declarative/util/qdeclarativeanimation_p.h @@ -447,6 +447,36 @@ protected: virtual QAbstractAnimation *qtAnimation(); }; +class QDeclarativeParentAnimationPrivate; +class QDeclarativeParentAnimation : public QDeclarativeAnimationGroup +{ + Q_OBJECT + Q_DECLARE_PRIVATE(QDeclarativeParentAnimation) + + Q_PROPERTY(QDeclarativeItem *target READ target WRITE setTarget) + //Q_PROPERTY(QDeclarativeItem *newParent READ newParent WRITE setNewParent) + Q_PROPERTY(QDeclarativeItem *via READ via WRITE setVia) + +public: + QDeclarativeParentAnimation(QObject *parent=0); + virtual ~QDeclarativeParentAnimation(); + + QDeclarativeItem *target() const; + void setTarget(QDeclarativeItem *); + + QDeclarativeItem *newParent() const; + void setNewParent(QDeclarativeItem *); + + QDeclarativeItem *via() const; + void setVia(QDeclarativeItem *); + +protected: + virtual void transition(QDeclarativeStateActions &actions, + QDeclarativeProperties &modified, + TransitionDirection direction); + virtual QAbstractAnimation *qtAnimation(); +}; + QT_END_NAMESPACE QML_DECLARE_TYPE(QDeclarativeAbstractAnimation) @@ -461,6 +491,7 @@ QML_DECLARE_TYPE(QDeclarativeSequentialAnimation) QML_DECLARE_TYPE(QDeclarativeParallelAnimation) QML_DECLARE_TYPE(QDeclarativeVector3dAnimation) QML_DECLARE_TYPE(QDeclarativeRotationAnimation) +QML_DECLARE_TYPE(QDeclarativeParentAnimation) QT_END_HEADER |