splinechartitem_p.h
43 lines
| 910 B
| 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
|
r476 | #include <QGraphicsItem> | ||
Marek Rosa
|
r295 | |||
QTCOMMERCIALCHART_BEGIN_NAMESPACE | ||||
Michal Klocek
|
r465 | class SplineChartItem : public XYChartItem | ||
Marek Rosa
|
r295 | { | ||
Q_OBJECT | ||||
public: | ||||
Michal Klocek
|
r476 | SplineChartItem(QSplineSeries* series, QGraphicsItem *parent = 0); | ||
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 | |||
Michal Klocek
|
r476 | void setLinePen(const QPen& pen); | ||
Michal Klocek
|
r465 | void setPointsVisible(bool visible); | ||
Michal Klocek
|
r476 | public slots: | ||
void handleUpdated(); | ||||
Michal Klocek
|
r465 | protected: | ||
Michal Klocek
|
r464 | void setGeometry(QVector<QPointF>& points); | ||
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; | ||||
QPen m_pen; | ||||
Michal Klocek
|
r476 | |||
Marek Rosa
|
r295 | }; | ||
QTCOMMERCIALCHART_END_NAMESPACE | ||||
Marek Rosa
|
r460 | #endif // SPLINECHARTITEM_P_H | ||