linechartitem_p.h
61 lines
| 1.6 KiB
| text/x-c
|
CLexer
Michal Klocek
|
r144 | #ifndef LINECHARTITEM_H | ||
#define LINECHARTITEM_H | ||||
Michal Klocek
|
r21 | |||
Tero Ahola
|
r30 | #include "qchartglobal.h" | ||
Tero Ahola
|
r104 | #include "chartitem_p.h" | ||
Michal Klocek
|
r139 | #include <QPen> | ||
Michal Klocek
|
r21 | |||
Tero Ahola
|
r30 | QTCOMMERCIALCHART_BEGIN_NAMESPACE | ||
Michal Klocek
|
r21 | |||
Michal Klocek
|
r131 | class ChartPresenter; | ||
Michal Klocek
|
r349 | class QLineSeries; | ||
Michal Klocek
|
r21 | |||
Michal Klocek
|
r144 | class LineChartItem : public QObject , public ChartItem | ||
Michal Klocek
|
r21 | { | ||
Michal Klocek
|
r131 | Q_OBJECT | ||
Michal Klocek
|
r21 | public: | ||
Michal Klocek
|
r349 | LineChartItem(ChartPresenter* presenter, QLineSeries* series,QGraphicsItem *parent = 0); | ||
Michal Klocek
|
r144 | ~ LineChartItem(){}; | ||
Michal Klocek
|
r21 | |||
//from QGraphicsItem | ||||
Michal Klocek
|
r67 | QRectF boundingRect() const; | ||
Tero Ahola
|
r108 | void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget); | ||
Michal Klocek
|
r131 | QPainterPath shape() const; | ||
Michal Klocek
|
r139 | |||
void setPen(const QPen& pen); | ||||
Michal Klocek
|
r389 | void setPointsVisible(bool visible); | ||
public slots: | ||||
void handlePointAdded(int index); | ||||
void handlePointRemoved(int index); | ||||
void handlePointReplaced(int index); | ||||
Michal Klocek
|
r392 | void handleUpdated(); | ||
Michal Klocek
|
r389 | void handleDomainChanged(const Domain& domain); | ||
void handleGeometryChanged(const QRectF& size); | ||||
Michal Klocek
|
r21 | |||
Michal Klocek
|
r391 | public: | ||
virtual void updateItem(QVector<QPointF>& oldPoints,QVector<QPointF>& newPoints); | ||||
virtual void updateItem(QVector<QPointF>& oldPoints,int index,QPointF& newPoint); | ||||
Michal Klocek
|
r421 | virtual void applyGeometry(QVector<QPointF>& points); | ||
Michal Klocek
|
r391 | void createPoints(int count); | ||
void clearPoints(int count); | ||||
QPointF calculateGeometryPoint(int index) const; | ||||
QVector<QPointF> calculateGeometryPoints() const; | ||||
Michal Klocek
|
r21 | |||
private: | ||||
Michal Klocek
|
r131 | ChartPresenter* m_presenter; | ||
QPainterPath m_path; | ||||
Michal Klocek
|
r392 | QLineSeries* m_series; | ||
Michal Klocek
|
r131 | QSizeF m_size; | ||
QRectF m_rect; | ||||
Michal Klocek
|
r150 | QRectF m_clipRect; | ||
Michal Klocek
|
r131 | Domain m_domain; | ||
Michal Klocek
|
r391 | QGraphicsItemGroup m_items; | ||
Michal Klocek
|
r389 | QVector<QPointF> m_points; | ||
Michal Klocek
|
r139 | QPen m_pen; | ||
Michal Klocek
|
r131 | |||
Michal Klocek
|
r21 | }; | ||
Tero Ahola
|
r30 | QTCOMMERCIALCHART_END_NAMESPACE | ||
Michal Klocek
|
r21 | |||
#endif | ||||