axisitem_p.h
47 lines
| 1.0 KiB
| text/x-c
|
CLexer
/ src / axisitem_p.h
Michal Klocek
|
r67 | #ifndef AXISITEM_H_ | ||
#define AXISITEM_H_ | ||||
#include "plotdomain_p.h" | ||||
Tero Ahola
|
r104 | #include "chartitem_p.h" | ||
Michal Klocek
|
r67 | #include <QGraphicsItem> | ||
QTCOMMERCIALCHART_BEGIN_NAMESPACE | ||||
Tero Ahola
|
r104 | class AxisItem : public ChartItem | ||
Michal Klocek
|
r67 | { | ||
public: | ||||
enum AxisType{X_AXIS,Y_AXIS}; | ||||
AxisItem(AxisType type = X_AXIS,QGraphicsItem* parent = 0); | ||||
~AxisItem(); | ||||
//from QGraphicsItem | ||||
QRectF boundingRect() const; | ||||
Michal Klocek
|
r85 | void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget){}; | ||
Michal Klocek
|
r67 | |||
Tero Ahola
|
r108 | public: // from ChartItem | ||
Michal Klocek
|
r115 | void setSize(const QSizeF &size); | ||
Michal Klocek
|
r67 | void setPlotDomain(const PlotDomain& data); | ||
Tero Ahola
|
r103 | public: | ||
Michal Klocek
|
r67 | void setLength(int length); | ||
void setWidth(int width); | ||||
AxisType axisType() const {return m_type;}; | ||||
Michal Klocek
|
r85 | private: | ||
void createItems(); | ||||
Michal Klocek
|
r67 | private: | ||
QRectF m_rect; | ||||
int m_ticks; | ||||
PlotDomain m_plotDomain; | ||||
QPainterPath m_path; | ||||
Michal Klocek
|
r85 | |||
QList<QGraphicsLineItem*> m_grid; | ||||
QList<QGraphicsRectItem*> m_shades; | ||||
QList<QGraphicsSimpleTextItem*> m_labels; | ||||
Michal Klocek
|
r67 | AxisType m_type; | ||
}; | ||||
QTCOMMERCIALCHART_END_NAMESPACE | ||||
#endif /* AXISITEM_H_ */ | ||||