bar.h
46 lines
| 1004 B
| text/x-c
|
CLexer
sauimone
|
r56 | #ifndef BAR_H | ||
#define BAR_H | ||||
Tero Ahola
|
r103 | #include "chartitemcontrol.h" | ||
sauimone
|
r56 | #include "qchartglobal.h" | ||
Tero Ahola
|
r103 | #include <QGraphicsItem> | ||
sauimone
|
r56 | |||
QTCOMMERCIALCHART_BEGIN_NAMESPACE | ||||
// Single bar item of chart | ||||
Tero Ahola
|
r103 | class Bar : public QGraphicsItem, public ChartItemControl | ||
sauimone
|
r56 | { | ||
public: | ||||
Tero Ahola
|
r103 | Bar(QGraphicsItem *parent=0); | ||
sauimone
|
r74 | |||
Tero Ahola
|
r103 | public: // from ChartItemControl | ||
void setPos (const QPointF & pos); | ||||
void resize(const QSize &size); | ||||
void setTheme(ChartTheme *theme); | ||||
void setPlotDomain(const PlotDomain& data); | ||||
sauimone
|
r56 | |||
// Layout Stuff | ||||
void resize( int w, int h ); // Size of bar. in screen coordinates. | ||||
void setColor( QColor col ); // Color of bar | ||||
void setPos(qreal x, qreal y); | ||||
public: | ||||
// From QGraphicsItem | ||||
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0); | ||||
QRectF boundingRect() const; | ||||
private: | ||||
int mHeight; | ||||
int mWidth; | ||||
qreal mXpos; | ||||
qreal mYpos; | ||||
QColor mColor; | ||||
sauimone
|
r74 | |||
PlotDomain mPlotDomain; | ||||
sauimone
|
r56 | }; | ||
QTCOMMERCIALCHART_END_NAMESPACE | ||||
#endif // BAR_H | ||||