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