splinechartitem_p.h
85 lines
| 2.5 KiB
| text/x-c
|
CLexer
Jani Honkonen
|
r794 | /**************************************************************************** | ||
** | ||||
** Copyright (C) 2012 Digia Plc | ||||
** 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$ | ||||
** | ||||
****************************************************************************/ | ||||
unknown
|
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. | ||||
Marek Rosa
|
r460 | #ifndef SPLINECHARTITEM_P_H | ||
#define SPLINECHARTITEM_P_H | ||||
Marek Rosa
|
r295 | |||
Marek Rosa
|
r401 | #include "qsplineseries.h" | ||
Michal Klocek
|
r1218 | #include "xychart_p.h" | ||
Michal Klocek
|
r622 | |||
Marek Rosa
|
r295 | QTCOMMERCIALCHART_BEGIN_NAMESPACE | ||
Michal Klocek
|
r1735 | class SplineAnimation; | ||
Michal Klocek
|
r2273 | class SplineChartItem : public XYChart | ||
Marek Rosa
|
r295 | { | ||
Q_OBJECT | ||||
Michal Klocek
|
r1218 | Q_INTERFACES(QGraphicsItem) | ||
Marek Rosa
|
r295 | public: | ||
Michal Klocek
|
r2273 | SplineChartItem(QSplineSeries *series, QGraphicsItem* item = 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
|
r1217 | void setControlGeometryPoints(QVector<QPointF>& points); | ||
QVector<QPointF> controlGeometryPoints() const; | ||||
Jani Honkonen
|
r2104 | void setAnimation(SplineAnimation *animation); | ||
ChartAnimation *animation() const; | ||||
Michal Klocek
|
r1217 | |||
sauimone
|
r775 | public Q_SLOTS: | ||
Michal Klocek
|
r476 | void handleUpdated(); | ||
Michal Klocek
|
r465 | protected: | ||
Michal Klocek
|
r1217 | void updateGeometry(); | ||
Marek Rosa
|
r2372 | QVector<QPointF> calculateControlPoints(const QVector<QPointF> &points); | ||
QVector<qreal> firstControlPoints(const QVector<qreal>& vector); | ||||
Jani Honkonen
|
r2097 | void updateChart(QVector<QPointF> &oldPoints, QVector<QPointF> &newPoints, int index); | ||
Michal Klocek
|
r1218 | void mousePressEvent(QGraphicsSceneMouseEvent *event); | ||
Marek Rosa
|
r2256 | void hoverEnterEvent(QGraphicsSceneHoverEvent *event); | ||
void hoverLeaveEvent(QGraphicsSceneHoverEvent *event); | ||||
Marek Rosa
|
r419 | |||
Michal Klocek
|
r465 | private: | ||
Marek Rosa
|
r961 | QSplineSeries *m_series; | ||
Michal Klocek
|
r465 | 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; | ||
Jani Honkonen
|
r2104 | SplineAnimation *m_animation; | ||
Michal Klocek
|
r476 | |||
Michal Klocek
|
r622 | friend class SplineAnimation; | ||
Marek Rosa
|
r295 | }; | ||
QTCOMMERCIALCHART_END_NAMESPACE | ||||
Marek Rosa
|
r460 | #endif // SPLINECHARTITEM_P_H | ||