QSint Library  0.2.2
Public Slots | Public Member Functions | Protected Member Functions | List of all members
QSint::PieChart Class Reference

Class representing a piechart widget. More...

#include <piechart.h>

Inheritance diagram for QSint::PieChart:
QSint::PlotterBase

Public Slots

void setActiveIndex (int index)
 Sets active column to the index.
 
void setActiveIndex (const QModelIndex &index)
 Sets active column to the index.column().
 

Public Member Functions

void setMargin (int margin)
 Sets margins between the widget borders and piechart to margin (default is 3).
 
int margin () const
 Retrieves current value of the margins between the widget borders and piechart.
 
- Public Member Functions inherited from QSint::PlotterBase
void setBorderPen (const QPen &pen)
 Sets pen of the plotter's border to pen.
 
const QPen & borderPen () const
 Retrieves plotter's border pen.
 
void setBackground (const QBrush &brush)
 Sets plotter's background to brush.
 
const QBrush & background () const
 Retrieves plotter background.
 
void setFont (const QFont &font)
 Sets font of the data item to font.
 
const QFont & font () const
 Retrieves data item font.
 
void setItemPen (const QPen &pen)
 Sets pen of the data item to pen.
 
void setHighlightTextColor (const QColor &color)
 Sets color of the highlighted data item text to color.
 
const QColor & highlightTextColor () const
 Retrieves highlighted data item text color.
 
void setHighlightPen (const QPen &pen)
 Sets pen of the highlighted data item to pen.
 
const QPen & highlightPen () const
 Retrieves highlighted data item pen.
 
void setHighlightBrush (const QBrush &brush)
 Sets brush of the highlighted data item to brush.
 
const QBrush & highlightBrush () const
 Retrieves highlighted data item brush.
 
void setHighlightAlpha (double alpha)
 
double highlightAlpha () const
 Retrieves highlighted data item opacity.
 
void setAntiAliasing (bool set)
 Enables (set=true, the default) or disables (set=false) painter's antialiasing.
 
AxisBase * axisX () const
 Retrieves X axis object.
 
AxisBase * axisY () const
 Retrieves Y axis object.
 
void setModel (QAbstractItemModel *model)
 Sets data model to model.
 
QAbstractItemModel * model () const
 Retrieves active data model or NULL if not set.
 
QRect dataRect () const
 Retrieves data rectangle (excluding margins and axes).
 
const QPoint & mousePos () const
 Retrieves current mouse cursor position in local coordinates.
 
QPoint globalMousePos () const
 Retrieves current mouse cursor position in global coordinates.
 
const QModelIndex & highlightedIndex () const
 Retrieves highlighted data model index, or invalid QModelIndex if nothing highlighted.
 

Protected Member Functions

virtual void drawContent (QPainter &p)
 Draws content of the plotter.
 
virtual void drawSegment (QPainter &p, const QRect &pieRect, const QModelIndex &index, double value, double angle1, double angle2, bool isHighlighted)
 
virtual void drawValue (QPainter &p, const QRect &pieRect, const QModelIndex &index, double value, double angle1, double angle2, bool isHighlighted)
 
- Protected Member Functions inherited from QSint::PlotterBase
virtual void drawBackground (QPainter &p)
 Draws default background of the plotter.
 
virtual void drawForeground (QPainter &p)
 Draws default foreground of the plotter.
 
virtual void drawAxes (QPainter &p)
 Draws axes of the plotter.
 

Additional Inherited Members

- Signals inherited from QSint::PlotterBase
void entered (const QModelIndex &index)
 
void pressed (const QModelIndex &index)
 Emitted when the mouse button has been pressed over the data item at index.
 
void clicked (const QModelIndex &index)
 Emitted when the mouse button has been clicked over the data item at index.
 
void doubleClicked (const QModelIndex &index)
 Emitted when the mouse button has been double clicked over the data item at index.
 

Detailed Description

Class representing a piechart widget.

Since
0.2.1
PieChart.png
An example of PieChart

PieChart represents single column of the model as a pie chart diagram. Use setActiveIndex() method to choose the active column within the model.

Member Function Documentation

void QSint::PieChart::drawSegment ( QPainter &  p,
const QRect &  pieRect,
const QModelIndex &  index,
double  value,
double  angle1,
double  angle2,
bool  isHighlighted 
)
protectedvirtual

Draws a signle pie chart segment using QPainter p. Chart is to be drawn in the rectangle pieRect. Current model index of the segment in index, current value is value. angle1 and angle2 are start and end angles of the segment (in gradus). isHighlighted is true when the segment is highlighted.

void QSint::PieChart::drawValue ( QPainter &  p,
const QRect &  pieRect,
const QModelIndex &  index,
double  value,
double  angle1,
double  angle2,
bool  isHighlighted 
)
protectedvirtual

Draws value signle pie chart segment using QPainter p. Chart is to be drawn in the rectangle pieRect. Current model index of the segment in index, current value is value. angle1 and angle2 are start and end angles of the segment (in gradus). isHighlighted is true when the segment is highlighted.


The documentation for this class was generated from the following files:

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