splinechartitem_p.h
85 lines
| 2.5 KiB
| text/x-c
|
CLexer
|
r794 | /**************************************************************************** | ||
** | ||||
|
r2432 | ** Copyright (C) 2013 Digia Plc | ||
|
r794 | ** All rights reserved. | ||
** For any questions to Digia, please use contact form at http://qt.digia.com | ||||
** | ||||
** This file is part of the Qt Commercial Charts Add-on. | ||||
** | ||||
** $QT_BEGIN_LICENSE$ | ||||
** Licensees holding valid Qt Commercial licenses may use this file in | ||||
** accordance with the Qt Commercial License Agreement provided with the | ||||
** Software or, alternatively, in accordance with the terms contained in | ||||
** a written agreement between you and Digia. | ||||
** | ||||
** If you have questions regarding the use of this file, please use | ||||
** contact form at http://qt.digia.com | ||||
** $QT_END_LICENSE$ | ||||
** | ||||
****************************************************************************/ | ||||
|
r1366 | // W A R N I N G | ||
// ------------- | ||||
// | ||||
// This file is not part of the QtCommercial Chart API. It exists purely as an | ||||
// implementation detail. This header file may change from version to | ||||
// version without notice, or even be removed. | ||||
// | ||||
// We mean it. | ||||
|
r460 | #ifndef SPLINECHARTITEM_P_H | ||
#define SPLINECHARTITEM_P_H | ||||
|
r295 | |||
|
r401 | #include "qsplineseries.h" | ||
|
r1218 | #include "xychart_p.h" | ||
|
r622 | |||
|
r295 | QTCOMMERCIALCHART_BEGIN_NAMESPACE | ||
|
r1735 | class SplineAnimation; | ||
|
r2273 | class SplineChartItem : public XYChart | ||
|
r295 | { | ||
Q_OBJECT | ||||
|
r1218 | Q_INTERFACES(QGraphicsItem) | ||
|
r295 | public: | ||
|
r2273 | SplineChartItem(QSplineSeries *series, QGraphicsItem* item = 0); | ||
|
r295 | |||
|
r465 | //from QGraphicsItem | ||
QRectF boundingRect() const; | ||||
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget); | ||||
QPainterPath shape() const; | ||||
|
r417 | |||
|
r1217 | void setControlGeometryPoints(QVector<QPointF>& points); | ||
QVector<QPointF> controlGeometryPoints() const; | ||||
|
r2104 | void setAnimation(SplineAnimation *animation); | ||
ChartAnimation *animation() const; | ||||
|
r1217 | |||
|
r775 | public Q_SLOTS: | ||
|
r476 | void handleUpdated(); | ||
|
r465 | protected: | ||
|
r1217 | void updateGeometry(); | ||
|
r2372 | QVector<QPointF> calculateControlPoints(const QVector<QPointF> &points); | ||
QVector<qreal> firstControlPoints(const QVector<qreal>& vector); | ||||
|
r2097 | void updateChart(QVector<QPointF> &oldPoints, QVector<QPointF> &newPoints, int index); | ||
|
r1218 | void mousePressEvent(QGraphicsSceneMouseEvent *event); | ||
|
r2256 | void hoverEnterEvent(QGraphicsSceneHoverEvent *event); | ||
void hoverLeaveEvent(QGraphicsSceneHoverEvent *event); | ||||
|
r419 | |||
|
r465 | private: | ||
|
r961 | QSplineSeries *m_series; | ||
|
r465 | QPainterPath m_path; | ||
QRectF m_rect; | ||||
|
r580 | QPen m_linePen; | ||
QPen m_pointPen; | ||||
bool m_pointsVisible; | ||||
|
r622 | QVector<QPointF> m_controlPoints; | ||
|
r2104 | SplineAnimation *m_animation; | ||
|
r476 | |||
|
r622 | friend class SplineAnimation; | ||
|
r295 | }; | ||
QTCOMMERCIALCHART_END_NAMESPACE | ||||
|
r460 | #endif // SPLINECHARTITEM_P_H | ||