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 QPIESERIES_P_H |
14 | #define QPIESERIES_P_H |
15 | |
16 | #include <QtCharts/QPieSeries> |
17 | #include <private/qabstractseries_p.h> |
18 | #include <QtCharts/private/qchartglobal_p.h> |
19 | |
20 | QT_BEGIN_NAMESPACE |
21 | class QLegendPrivate; |
22 | |
23 | class Q_CHARTS_PRIVATE_EXPORT QPieSeriesPrivate : public QAbstractSeriesPrivate |
24 | { |
25 | Q_OBJECT |
26 | |
27 | public: |
28 | QPieSeriesPrivate(QPieSeries *parent); |
29 | ~QPieSeriesPrivate(); |
30 | |
31 | void initializeDomain() override; |
32 | void initializeAxes() override; |
33 | void initializeGraphics(QGraphicsItem* parent) override; |
34 | void initializeAnimations(QChart::AnimationOptions options, int duration, |
35 | QEasingCurve &curve) override; |
36 | void initializeTheme(int index, ChartTheme* theme, bool forced = false) override; |
37 | |
38 | QList<QLegendMarker *> createLegendMarkers(QLegend *legend) override; |
39 | |
40 | QAbstractAxis::AxisType defaultAxisType(Qt::Orientation orientation) const override; |
41 | QAbstractAxis* createDefaultAxis(Qt::Orientation orientation) const override; |
42 | |
43 | void updateDerivativeData(); |
44 | void setSizes(qreal innerSize, qreal outerSize); |
45 | |
46 | static QPieSeriesPrivate *fromSeries(QPieSeries *series); |
47 | |
48 | Q_SIGNALS: |
49 | void calculatedDataChanged(); |
50 | void pieSizeChanged(); |
51 | void pieStartAngleChanged(); |
52 | void pieEndAngleChanged(); |
53 | void horizontalPositionChanged(); |
54 | void verticalPositionChanged(); |
55 | |
56 | public Q_SLOTS: |
57 | void sliceValueChanged(); |
58 | void sliceClicked(); |
59 | void sliceHovered(bool state); |
60 | void slicePressed(); |
61 | void sliceReleased(); |
62 | void sliceDoubleClicked(); |
63 | |
64 | private: |
65 | QList<QPieSlice *> m_slices; |
66 | qreal m_pieRelativeHorPos; |
67 | qreal m_pieRelativeVerPos; |
68 | qreal m_pieRelativeSize; |
69 | qreal m_pieStartAngle; |
70 | qreal m_pieEndAngle; |
71 | qreal m_sum; |
72 | qreal m_holeRelativeSize; |
73 | |
74 | public: |
75 | friend class QLegendPrivate; |
76 | Q_DECLARE_PUBLIC(QPieSeries) |
77 | }; |
78 | |
79 | QT_END_NAMESPACE |
80 | |
81 | #endif // QPIESERIES_P_H |
82 | |