linechartitem_p.h
54 lines
| 1.1 KiB
| text/x-c
|
CLexer
|
r144 | #ifndef LINECHARTITEM_H | ||
#define LINECHARTITEM_H | ||||
|
r21 | |||
|
r30 | #include "qchartglobal.h" | ||
|
r465 | #include "xychartitem_p.h" | ||
|
r476 | #include "xychartanimationitem_p.h" | ||
|
r139 | #include <QPen> | ||
|
r21 | |||
|
r30 | QTCOMMERCIALCHART_BEGIN_NAMESPACE | ||
|
r21 | |||
|
r131 | class ChartPresenter; | ||
|
r349 | class QLineSeries; | ||
|
r21 | |||
|
r465 | class LineChartItem : public XYChartItem | ||
|
r21 | { | ||
|
r131 | Q_OBJECT | ||
|
r21 | public: | ||
|
r470 | explicit LineChartItem(QLineSeries* series,QGraphicsItem *parent = 0); | ||
|
r144 | ~ LineChartItem(){}; | ||
|
r21 | |||
//from QGraphicsItem | ||||
|
r67 | QRectF boundingRect() const; | ||
|
r108 | void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget); | ||
|
r131 | QPainterPath shape() const; | ||
|
r139 | |||
|
r476 | void setLinePen(const QPen& pen); | ||
|
r389 | void setPointsVisible(bool visible); | ||
public slots: | ||||
|
r392 | void handleUpdated(); | ||
|
r21 | |||
|
r464 | protected: | ||
virtual void setGeometry(QVector<QPointF>& points); | ||||
|
r470 | private: | ||
void createPoints(int count); | ||||
void deletePoints(int count); | ||||
|
r465 | private: | ||
|
r419 | QLineSeries* m_series; | ||
|
r391 | QGraphicsItemGroup m_items; | ||
|
r465 | QPainterPath m_path; | ||
QRectF m_rect; | ||||
|
r139 | QPen m_pen; | ||
|
r131 | |||
|
r476 | template<class,class> friend class XYChartAnimator; | ||
|
r464 | |||
|
r21 | }; | ||
|
r476 | typedef XYChartAnimationItem<LineChartItem,QLineSeries> LineChartAnimationItem; | ||
|
r30 | QTCOMMERCIALCHART_END_NAMESPACE | ||
|
r21 | |||
#endif | ||||