1 | // Copyright (C) 2016 The Qt Company Ltd. |
---|---|
2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only |
3 | |
4 | #ifndef QT3DANIMATION_QANIMATIONGROUP_H |
5 | #define QT3DANIMATION_QANIMATIONGROUP_H |
6 | |
7 | #include <QtCore/qobject.h> |
8 | |
9 | #include <Qt3DAnimation/qabstractanimation.h> |
10 | |
11 | #include <Qt3DAnimation/qt3danimation_global.h> |
12 | |
13 | QT_BEGIN_NAMESPACE |
14 | |
15 | namespace Qt3DAnimation { |
16 | |
17 | class QAnimationGroupPrivate; |
18 | |
19 | class Q_3DANIMATIONSHARED_EXPORT QAnimationGroup : public QObject |
20 | { |
21 | Q_OBJECT |
22 | Q_PROPERTY(QString name READ name WRITE setName NOTIFY nameChanged) |
23 | Q_PROPERTY(float position READ position WRITE setPosition NOTIFY positionChanged) |
24 | Q_PROPERTY(float duration READ duration NOTIFY durationChanged) |
25 | |
26 | public: |
27 | explicit QAnimationGroup(QObject *parent = nullptr); |
28 | |
29 | QString name() const; |
30 | QList<Qt3DAnimation::QAbstractAnimation *> animationList(); |
31 | float position() const; |
32 | float duration() const; |
33 | |
34 | void setAnimations(const QList<Qt3DAnimation::QAbstractAnimation *> &animations); |
35 | void addAnimation(Qt3DAnimation::QAbstractAnimation *animation); |
36 | void removeAnimation(Qt3DAnimation::QAbstractAnimation *animation); |
37 | |
38 | public Q_SLOTS: |
39 | void setName(const QString &name); |
40 | void setPosition(float position); |
41 | |
42 | Q_SIGNALS: |
43 | void nameChanged(const QString &name); |
44 | void positionChanged(float position); |
45 | void durationChanged(float duration); |
46 | |
47 | private: |
48 | |
49 | Q_DECLARE_PRIVATE(QAnimationGroup) |
50 | }; |
51 | |
52 | } // Qt3DAnimation |
53 | |
54 | QT_END_NAMESPACE |
55 | |
56 | #endif // QT3DANIMATION_QANIMATIONGROUP_H |
57 |