| 1 | // Copyright (C) 2024 The Qt Company Ltd. | 
| 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only | 
| 3 |  | 
| 4 | #ifndef QPIESLICE_P_H | 
| 5 | #define QPIESLICE_P_H | 
| 6 |  | 
| 7 | //  W A R N I N G | 
| 8 | //  ------------- | 
| 9 | // | 
| 10 | // This file is not part of the QtGraphs API.  It exists purely as an | 
| 11 | // implementation detail.  This header file may change from version to | 
| 12 | // version without notice, or even be removed. | 
| 13 | // | 
| 14 | // We mean it. | 
| 15 |  | 
| 16 | #include <QtCore/private/qobject_p.h> | 
| 17 | #include <QtCore/qpoint.h> | 
| 18 | #include <QtGraphs/qpieslice.h> | 
| 19 | #include <QtGui/QColor> | 
| 20 | #include <QtGui/QFont> | 
| 21 |  | 
| 22 | QT_BEGIN_NAMESPACE | 
| 23 |  | 
| 24 | class QPieSeries; | 
| 25 | class QQuickPathArc; | 
| 26 | class QQuickPathLine; | 
| 27 | class QQuickShape; | 
| 28 | class QQuickShapePath; | 
| 29 | class QQuickText; | 
| 30 |  | 
| 31 | class QPieSlicePrivate : public QObjectPrivate | 
| 32 | { | 
| 33 | public: | 
| 34 |     QPieSlicePrivate(); | 
| 35 |     ~QPieSlicePrivate() override; | 
| 36 |  | 
| 37 |     void setPercentage(qreal percentage); | 
| 38 |     void setStartAngle(qreal angle); | 
| 39 |     void setAngleSpan(qreal span); | 
| 40 |  | 
| 41 | private: | 
| 42 |     friend class QPieSeries; | 
| 43 |     friend class QPieSeriesPrivate; | 
| 44 |     friend class PieRenderer; | 
| 45 |  | 
| 46 |     void setLabelVisible(bool visible); | 
| 47 |     void setLabelPosition(QPieSlice::LabelPosition position); | 
| 48 |  | 
| 49 |     QString m_labelText; | 
| 50 |     bool m_isLabelVisible; | 
| 51 |     QPieSlice::LabelPosition m_labelPosition; | 
| 52 |     QColor m_color; | 
| 53 |     QColor m_labelColor; | 
| 54 |     QFont m_labelFont; | 
| 55 |     qreal m_labelArmLengthFactor; | 
| 56 |     qreal m_value; | 
| 57 |     qreal m_percentage; | 
| 58 |     qreal m_startAngle; | 
| 59 |     qreal m_angleSpan; | 
| 60 |     bool m_isExploded; | 
| 61 |     qreal m_explodeDistanceFactor; | 
| 62 |  | 
| 63 |     bool m_labelDirty; | 
| 64 |  | 
| 65 |     QColor m_borderColor; | 
| 66 |     qreal m_borderWidth; | 
| 67 |  | 
| 68 |     QQuickShapePath *m_shapePath; | 
| 69 |     QQuickText *m_labelItem = nullptr; | 
| 70 |     QQuickShape *m_labelShape = nullptr; | 
| 71 |     QQuickShapePath *m_labelPath = nullptr; | 
| 72 |  | 
| 73 |     QPointF m_largeArc; | 
| 74 |     QPointF m_centerLine; | 
| 75 |     QPointF m_labelArm; | 
| 76 |  | 
| 77 |     QPieSeries *m_series = nullptr; | 
| 78 |  | 
| 79 |     Q_DECLARE_PUBLIC(QPieSlice) | 
| 80 | }; | 
| 81 |  | 
| 82 | QT_END_NAMESPACE | 
| 83 |  | 
| 84 | #endif // QPIESLICE_P_H | 
| 85 |  |