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