| 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 QANIMATIONGROUP_P_H |
| 5 | #define QANIMATIONGROUP_P_H |
| 6 | |
| 7 | // |
| 8 | // W A R N I N G |
| 9 | // ------------- |
| 10 | // |
| 11 | // This file is not part of the Qt API. It exists purely as an |
| 12 | // implementation detail. This header file may change from version to |
| 13 | // version without notice, or even be removed. |
| 14 | // |
| 15 | // We mean it. |
| 16 | // |
| 17 | |
| 18 | #include "qanimationgroup.h" |
| 19 | |
| 20 | #include <QtCore/qlist.h> |
| 21 | |
| 22 | #include "private/qabstractanimation_p.h" |
| 23 | |
| 24 | QT_REQUIRE_CONFIG(animation); |
| 25 | |
| 26 | QT_BEGIN_NAMESPACE |
| 27 | |
| 28 | class QAnimationGroupPrivate : public QAbstractAnimationPrivate |
| 29 | { |
| 30 | Q_DECLARE_PUBLIC(QAnimationGroup) |
| 31 | public: |
| 32 | QAnimationGroupPrivate() |
| 33 | { |
| 34 | isGroup = true; |
| 35 | } |
| 36 | |
| 37 | virtual void animationInsertedAt(qsizetype) { } |
| 38 | virtual void animationRemoved(qsizetype, QAbstractAnimation *); |
| 39 | |
| 40 | void clear(bool onDestruction); |
| 41 | |
| 42 | void disconnectUncontrolledAnimation(QAbstractAnimation *anim) |
| 43 | { |
| 44 | //0 for the signal here because we might be called from the animation destructor |
| 45 | QObject::disconnect(sender: anim, signal: nullptr, receiver: q_func(), SLOT(_q_uncontrolledAnimationFinished())); |
| 46 | } |
| 47 | |
| 48 | void connectUncontrolledAnimation(QAbstractAnimation *anim) |
| 49 | { |
| 50 | QObject::connect(sender: anim, SIGNAL(finished()), receiver: q_func(), SLOT(_q_uncontrolledAnimationFinished())); |
| 51 | } |
| 52 | |
| 53 | QList<QAbstractAnimation *> animations; |
| 54 | }; |
| 55 | |
| 56 | QT_END_NAMESPACE |
| 57 | |
| 58 | #endif //QANIMATIONGROUP_P_H |
| 59 |
