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 QSEQUENTIALANIMATIONGROUP_H
5#define QSEQUENTIALANIMATIONGROUP_H
6
7#include <QtCore/qanimationgroup.h>
8
9QT_REQUIRE_CONFIG(animation);
10
11QT_BEGIN_NAMESPACE
12
13class QPauseAnimation;
14class QSequentialAnimationGroupPrivate;
15
16class Q_CORE_EXPORT QSequentialAnimationGroup : public QAnimationGroup
17{
18 Q_OBJECT
19 Q_PROPERTY(QAbstractAnimation *currentAnimation READ currentAnimation
20 NOTIFY currentAnimationChanged BINDABLE bindableCurrentAnimation)
21
22public:
23 QSequentialAnimationGroup(QObject *parent = nullptr);
24 ~QSequentialAnimationGroup();
25
26 QPauseAnimation *addPause(int msecs);
27 QPauseAnimation *insertPause(int index, int msecs);
28
29 QAbstractAnimation *currentAnimation() const;
30 QBindable<QAbstractAnimation *> bindableCurrentAnimation() const;
31 int duration() const override;
32
33Q_SIGNALS:
34 void currentAnimationChanged(QAbstractAnimation *current);
35
36protected:
37 QSequentialAnimationGroup(QSequentialAnimationGroupPrivate &dd, QObject *parent);
38 bool event(QEvent *event) override;
39
40 void updateCurrentTime(int) override;
41 void updateState(QAbstractAnimation::State newState, QAbstractAnimation::State oldState) override;
42 void updateDirection(QAbstractAnimation::Direction direction) override;
43
44private:
45 Q_DISABLE_COPY(QSequentialAnimationGroup)
46 Q_DECLARE_PRIVATE(QSequentialAnimationGroup)
47 Q_PRIVATE_SLOT(d_func(), void _q_uncontrolledAnimationFinished())
48};
49
50QT_END_NAMESPACE
51
52#endif //QSEQUENTIALANIMATIONGROUP_H
53

source code of qtbase/src/corelib/animation/qsequentialanimationgroup.h