Quark  0.1
PieChartView.h++
Go to the documentation of this file.
1 #ifndef __libquark_chart_PieChartView_hxx
2 #define __libquark_chart_PieChartView_hxx
3 
4 #include <QVarLengthArray>
5 
6 #include <quark/ChartView.h++>
7 
8 namespace quark {
9 namespace chart {
10 
12 {
13  public:
14 
15  PieChartView(QWidget *parent = NULL);
16  virtual ~PieChartView();
17 
18  void setPieDepth(int pieDepth);
19  int pieDepth() const
20  { return(_pieDepth); }
21 
22  void setPieWidth(int pieWidth);
23  int pieWidth() const
24  { return(_pieWidth); }
25 
26  void setPieHeight(int pieHeight);
27  int pieHeight() const
28  { return(_pieHeight); }
29 
30  void setDrawsLabels(bool drawsLabels);
31  bool drawsLabels() const
32  { return(_drawsLabels); }
33 
34  protected:
35 
36  virtual void paintEvent(QPaintEvent *event);
37 
38  virtual bool hasScale() const
39  { return(false); }
40 
41  virtual void dataChanged();
42 
43  private:
44 
45  void recalculateValues();
46 
47  qreal _aspectRatio;
48  int _pieDepth;
49  int _pieWidth;
50  int _pieHeight;
51  int _centerX;
52  int _centerY;
53  int _radiusX;
54  int _radiusY;
55  bool _drawsLabels;
56  QVarLengthArray<qreal> _slices;
57  qreal _total;
58 
59  Q_DISABLE_COPY(PieChartView);
60 };
61 
62 } // namespace chart
63 } // namespace quark
64 
65 #endif // __libquark_chart_PieChartView_hxx
virtual bool hasScale() const
Definition: PieChartView.h++:38
Definition: PieChartView.h++:11
Definition: BarChartView.h++:6
int pieDepth() const
Definition: PieChartView.h++:19
Definition: ChartView.h++:15
int pieWidth() const
Definition: PieChartView.h++:23
bool drawsLabels() const
Definition: PieChartView.h++:31
int pieHeight() const
Definition: PieChartView.h++:27
#define LIBQUARK_API
Definition: Quark.h++:18