##// END OF EJS Templates
One more alternative for changing themes
One more alternative for changing themes

File last commit:

r108:4cbe204cc325
r108:4cbe204cc325
Show More
percentbargroup.h
57 lines | 1.4 KiB | text/x-c | CLexer
sauimone
percent bar chart
r101 #ifndef PERCENTBARGROUP_H
#define PERCENTBARGROUP_H
Tero Ahola
Refactoring continued: restored ChartItem class
r104 #include "chartitem_p.h"
sauimone
percent bar chart
r101 #include "bar.h"
#include "percentbarchartseries.h"
Tero Ahola
Refactored themes; now enabled for line, scatter and pies...
r103 #include <QGraphicsItem>
sauimone
percent bar chart
r101
QTCOMMERCIALCHART_BEGIN_NAMESPACE
Tero Ahola
Refactoring continued: restored ChartItem class
r104 class PercentBarGroup : public ChartItem
sauimone
percent bar chart
r101 {
public:
PercentBarGroup(PercentBarChartSeries& series, QGraphicsItem *parent = 0);
Tero Ahola
One more alternative for changing themes
r108 public: // From ChartItem
Tero Ahola
Refactoring continued: restored ChartItem class
r104 void setSize(const QSize &size);
Tero Ahola
Refactored themes; now enabled for line, scatter and pies...
r103 void setPlotDomain(const PlotDomain& data);
sauimone
percent bar chart
r101
Tero Ahola
Refactored themes; now enabled for line, scatter and pies...
r103 public:
sauimone
percent bar chart
r101 // Layout "api"
void setPos(qreal x, qreal y);
void setBarWidth( int w ); // Default width for each bar
int addColor( QColor color );
void resetColors();
// From QGraphicsItem
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
QRectF boundingRect() const;
private:
void dataChanged(); // data of series has changed -> need to recalculate bar sizes
void layoutChanged(); // layout has changed -> need to recalculate bar sizes
private:
// Data
PercentBarChartSeries& mSeries;
int mMin; // Min and max values of data. (updated when data is changed, used when drawing)
int mMax;
int mHeight; // Layout spesific
int mWidth;
int mBarDefaultWidth;
bool mLayoutSet; // True, if component has been laid out.
bool mLayoutDirty;
QList<QColor> mColors; // List of colors for series for now
};
QTCOMMERCIALCHART_END_NAMESPACE
#endif // PERCENTBARGROUP_H