@@ -1,71 +1,71 | |||
|
1 | 1 | #ifndef QPIESLICE_H |
|
2 | 2 | #define QPIESLICE_H |
|
3 | 3 | |
|
4 | 4 | #include <qchartglobal.h> |
|
5 | 5 | #include <QObject> |
|
6 | 6 | #include <QPen> |
|
7 | 7 | #include <QBrush> |
|
8 | 8 | #include <QFont> |
|
9 | 9 | |
|
10 | 10 | QTCOMMERCIALCHART_BEGIN_NAMESPACE |
|
11 | 11 | class QPieSlicePrivate; |
|
12 | 12 | |
|
13 | 13 | class QTCOMMERCIALCHART_EXPORT QPieSlice : public QObject |
|
14 | 14 | { |
|
15 | 15 | Q_OBJECT |
|
16 | 16 | Q_PROPERTY(QString label READ label WRITE setLabel NOTIFY changed) |
|
17 | 17 | Q_PROPERTY(qreal value READ value WRITE setValue NOTIFY changed) |
|
18 | 18 | |
|
19 | 19 | public: |
|
20 | 20 | QPieSlice(QObject *parent = 0); |
|
21 | 21 | QPieSlice(qreal value, QString label, QObject *parent = 0); |
|
22 | 22 | virtual ~QPieSlice(); |
|
23 | 23 | |
|
24 | 24 | // data |
|
25 | 25 | void setValue(qreal value); |
|
26 | 26 | qreal value() const; |
|
27 | 27 | void setLabel(QString label); |
|
28 | 28 | QString label() const; |
|
29 | void setLabelVisible(bool visible); | |
|
29 | void setLabelVisible(bool visible = true); | |
|
30 | 30 | bool isLabelVisible() const; |
|
31 | void setExploded(bool exploded); | |
|
31 | void setExploded(bool exploded = true); | |
|
32 | 32 | bool isExploded() const; |
|
33 | 33 | |
|
34 | 34 | // generated data |
|
35 | 35 | qreal percentage() const; |
|
36 | 36 | qreal startAngle() const; |
|
37 | 37 | qreal endAngle() const; |
|
38 | 38 | |
|
39 | 39 | // customization |
|
40 | 40 | void setSlicePen(const QPen &pen); |
|
41 | 41 | QPen slicePen() const; |
|
42 | 42 | void setSliceBrush(const QBrush &brush); |
|
43 | 43 | QBrush sliceBrush() const; |
|
44 | 44 | void setLabelArmPen(const QPen &pen); |
|
45 | 45 | QPen labelArmPen() const; |
|
46 | 46 | void setLabelFont(const QFont &font); |
|
47 | 47 | QFont labelFont() const; |
|
48 | 48 | void setLabelArmLengthFactor(qreal factor); |
|
49 | 49 | qreal labelArmLengthFactor() const; |
|
50 | 50 | void setExplodeDistanceFactor(qreal factor); |
|
51 | 51 | qreal explodeDistanceFactor() const; |
|
52 | 52 | |
|
53 | 53 | Q_SIGNALS: |
|
54 | 54 | void clicked(); |
|
55 | 55 | void hoverEnter(); |
|
56 | 56 | void hoverLeave(); |
|
57 | 57 | void changed(); |
|
58 | 58 | |
|
59 | 59 | private: |
|
60 | 60 | QPieSlicePrivate * const d_ptr; |
|
61 | 61 | Q_DECLARE_PRIVATE(QPieSlice) |
|
62 | 62 | Q_DISABLE_COPY(QPieSlice) |
|
63 | 63 | |
|
64 | 64 | public: |
|
65 | 65 | typedef QPieSlicePrivate * const DataPtr; |
|
66 | 66 | inline DataPtr &data_ptr() { return d_ptr; } |
|
67 | 67 | }; |
|
68 | 68 | |
|
69 | 69 | QTCOMMERCIALCHART_END_NAMESPACE |
|
70 | 70 | |
|
71 | 71 | #endif // QPIESLICE_H |
General Comments 0
You need to be logged in to leave comments.
Login now