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 QWIDGET_ANIMATOR_P_H
5#define QWIDGET_ANIMATOR_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 <QtWidgets/private/qtwidgetsglobal_p.h>
19#include <qobject.h>
20#include <qhash.h>
21#include <qpointer.h>
22
23QT_BEGIN_NAMESPACE
24
25class QWidget;
26class QMainWindowLayout;
27class QPropertyAnimation;
28class QRect;
29
30class QWidgetAnimator : public QObject
31{
32 Q_OBJECT
33public:
34 QWidgetAnimator(QMainWindowLayout *layout);
35 void animate(QWidget *widget, const QRect &final_geometry, bool animate);
36 bool animating() const;
37
38 void abort(QWidget *widget);
39
40#if QT_CONFIG(animation)
41private Q_SLOTS:
42 void animationFinished();
43#endif
44
45private:
46 typedef QHash<QWidget*, QPointer<QPropertyAnimation> > AnimationMap;
47 AnimationMap m_animation_map;
48#if QT_CONFIG(mainwindow)
49 QMainWindowLayout *m_mainWindowLayout;
50#endif
51};
52
53QT_END_NAMESPACE
54
55#endif // QWIDGET_ANIMATOR_P_H
56

source code of qtbase/src/widgets/widgets/qwidgetanimator_p.h