splinechartitem_p.h
46 lines
| 1.0 KiB
| text/x-c
|
CLexer
|
r460 | #ifndef SPLINECHARTITEM_P_H | ||
#define SPLINECHARTITEM_P_H | ||||
|
r295 | |||
|
r401 | #include "qsplineseries.h" | ||
|
r465 | #include "xychartitem_p.h" | ||
|
r476 | #include <QGraphicsItem> | ||
|
r295 | |||
|
r622 | |||
|
r295 | QTCOMMERCIALCHART_BEGIN_NAMESPACE | ||
|
r465 | class SplineChartItem : public XYChartItem | ||
|
r295 | { | ||
Q_OBJECT | ||||
public: | ||||
|
r476 | SplineChartItem(QSplineSeries* series, QGraphicsItem *parent = 0); | ||
|
r295 | |||
|
r465 | //from QGraphicsItem | ||
QRectF boundingRect() const; | ||||
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget); | ||||
QPainterPath shape() const; | ||||
|
r417 | |||
|
r476 | public slots: | ||
void handleUpdated(); | ||||
|
r465 | protected: | ||
|
r622 | void setLayout(QVector<QPointF>& points,QVector<QPointF>& controlPoints); | ||
void updateLayout(QVector<QPointF>& oldPoints,QVector<QPointF>& newPoints,int index); | ||||
|
r419 | |||
|
r465 | private: | ||
|
r419 | QPointF calculateGeometryControlPoint(int index) const; | ||
|
r465 | private: | ||
QSplineSeries* m_series; | ||||
QPainterPath m_path; | ||||
QRectF m_rect; | ||||
|
r580 | QPen m_linePen; | ||
QPen m_pointPen; | ||||
bool m_pointsVisible; | ||||
|
r622 | QVector<QPointF> m_controlPoints; | ||
|
r476 | |||
|
r622 | friend class SplineAnimation; | ||
|
r295 | }; | ||
QTCOMMERCIALCHART_END_NAMESPACE | ||||
|
r460 | #endif // SPLINECHARTITEM_P_H | ||