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
21QT_BEGIN_NAMESPACE
22
23class PieChartItem;
24
25class Q_CHARTS_PRIVATE_EXPORT PieAnimation : public ChartAnimation
26{
27 Q_OBJECT
28
29public:
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
36public: // from QVariantAnimation
37 void updateCurrentValue(const QVariant &value) override;
38
39private:
40 PieChartItem *m_item;
41 QHash<PieSliceItem *, PieSliceAnimation *> m_animations;
42 int m_animationDuration;
43 QEasingCurve m_animationCurve;
44};
45
46QT_END_NAMESPACE
47
48#endif
49

source code of qtcharts/src/charts/animations/pieanimation_p.h