1 | // Copyright (C) 2016 The Qt Company Ltd. |
---|---|
2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only |
3 | |
4 | // W A R N I N G |
5 | // ------------- |
6 | // |
7 | // This file is not part of the Qt Chart API. It exists purely as an |
8 | // implementation detail. This header file may change from version to |
9 | // version without notice, or even be removed. |
10 | // |
11 | // We mean it. |
12 | |
13 | #ifndef PIEANIMATION_P_H |
14 | #define PIEANIMATION_P_H |
15 | |
16 | #include <private/chartanimation_p.h> |
17 | #include <private/piechartitem_p.h> |
18 | #include <private/piesliceanimation_p.h> |
19 | #include <QtCharts/private/qchartglobal_p.h> |
20 | |
21 | QT_BEGIN_NAMESPACE |
22 | |
23 | class PieChartItem; |
24 | |
25 | class Q_CHARTS_PRIVATE_EXPORT PieAnimation : public ChartAnimation |
26 | { |
27 | Q_OBJECT |
28 | |
29 | public: |
30 | PieAnimation(PieChartItem *item, int duration, QEasingCurve &curve); |
31 | ~PieAnimation(); |
32 | ChartAnimation *updateValue(PieSliceItem *sliceItem, const PieSliceData &newValue); |
33 | ChartAnimation *addSlice(PieSliceItem *sliceItem, const PieSliceData &endValue, bool startupAnimation); |
34 | ChartAnimation *removeSlice(PieSliceItem *sliceItem); |
35 | |
36 | public: // from QVariantAnimation |
37 | void updateCurrentValue(const QVariant &value) override; |
38 | |
39 | private: |
40 | PieChartItem *m_item; |
41 | QHash<PieSliceItem *, PieSliceAnimation *> m_animations; |
42 | int m_animationDuration; |
43 | QEasingCurve m_animationCurve; |
44 | }; |
45 | |
46 | QT_END_NAMESPACE |
47 | |
48 | #endif |
49 |