QSint Library  0.2.2
piechart.h
1 #ifndef PIECHART_H
2 #define PIECHART_H
3 
4 
5 #include "plotterbase.h"
6 
7 
8 namespace QSint
9 {
10 
11 
21 class PieChart : public PlotterBase
22 {
23  Q_OBJECT
24 
25 public:
26  PieChart(QWidget *parent = 0);
27 
29  void setMargin(int margin);
31  inline int margin() const { return m_margin; }
32 
33 public Q_SLOTS:
35  void setActiveIndex(int index);
37  void setActiveIndex(const QModelIndex &index);
38 
39 protected:
40  virtual void drawContent(QPainter &p);
41 
48  virtual void drawSegment(QPainter &p, const QRect& pieRect,
49  const QModelIndex &index, double value,
50  double angle1, double angle2,
51  bool isHighlighted);
52 
59  virtual void drawValue(QPainter &p, const QRect& pieRect,
60  const QModelIndex &index, double value,
61  double angle1, double angle2,
62  bool isHighlighted);
63 protected:
64  int m_index;
65 
66  int m_margin;
67 };
68 
69 
70 }
71 
72 
73 #endif
void setMargin(int margin)
Sets margins between the widget borders and piechart to margin (default is 3).
Definition: piechart.cpp:21
virtual void drawSegment(QPainter &p, const QRect &pieRect, const QModelIndex &index, double value, double angle1, double angle2, bool isHighlighted)
Definition: piechart.cpp:166
int margin() const
Retrieves current value of the margins between the widget borders and piechart.
Definition: piechart.h:31
virtual void drawContent(QPainter &p)
Draws content of the plotter.
Definition: piechart.cpp:56
virtual void drawValue(QPainter &p, const QRect &pieRect, const QModelIndex &index, double value, double angle1, double angle2, bool isHighlighted)
Definition: piechart.cpp:192
void setActiveIndex(int index)
Sets active column to the index.
Definition: piechart.cpp:32
Base class for 2-dimensional plotter widgets.
Definition: plotterbase.h:36
Class representing a piechart widget.
Definition: piechart.h:21

© Sintegrial Technologies 2011-2014
http://www.sintegrial.com