linechartitem_p.h
54 lines
| 1.1 KiB
| text/x-c
|
CLexer
Michal Klocek
|
r144 | #ifndef LINECHARTITEM_H | ||
#define LINECHARTITEM_H | ||||
Michal Klocek
|
r21 | |||
Tero Ahola
|
r30 | #include "qchartglobal.h" | ||
Michal Klocek
|
r465 | #include "xychartitem_p.h" | ||
Michal Klocek
|
r476 | #include "xychartanimationitem_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
|
r465 | class LineChartItem : public XYChartItem | ||
Michal Klocek
|
r21 | { | ||
Michal Klocek
|
r131 | Q_OBJECT | ||
Michal Klocek
|
r21 | public: | ||
Michal Klocek
|
r470 | explicit LineChartItem(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 | |||
Michal Klocek
|
r476 | void setLinePen(const QPen& pen); | ||
Michal Klocek
|
r389 | void setPointsVisible(bool visible); | ||
public slots: | ||||
Michal Klocek
|
r392 | void handleUpdated(); | ||
Michal Klocek
|
r21 | |||
Michal Klocek
|
r464 | protected: | ||
virtual void setGeometry(QVector<QPointF>& points); | ||||
Michal Klocek
|
r470 | private: | ||
void createPoints(int count); | ||||
void deletePoints(int count); | ||||
Michal Klocek
|
r465 | private: | ||
Marek Rosa
|
r419 | QLineSeries* m_series; | ||
Michal Klocek
|
r391 | QGraphicsItemGroup m_items; | ||
Michal Klocek
|
r465 | QPainterPath m_path; | ||
QRectF m_rect; | ||||
Michal Klocek
|
r139 | QPen m_pen; | ||
Michal Klocek
|
r131 | |||
Michal Klocek
|
r476 | template<class,class> friend class XYChartAnimator; | ||
Michal Klocek
|
r464 | |||
Michal Klocek
|
r21 | }; | ||
Michal Klocek
|
r476 | typedef XYChartAnimationItem<LineChartItem,QLineSeries> LineChartAnimationItem; | ||
Tero Ahola
|
r30 | QTCOMMERCIALCHART_END_NAMESPACE | ||
Michal Klocek
|
r21 | |||
#endif | ||||