linechartanimationitem_p.h
50 lines
| 1.1 KiB
| text/x-c
|
CLexer
|
r145 | #ifndef LINECHARTANIMATIONITEM_P_H_ | ||
#define LINECHARTANIMATIONITEM_P_H_ | ||||
|
r131 | |||
#include "qchartglobal.h" | ||||
|
r145 | #include "linechartitem_p.h" | ||
|
r131 | #include "domain_p.h" | ||
|
r391 | #include <QVariantAnimation> | ||
|
r131 | |||
QTCOMMERCIALCHART_BEGIN_NAMESPACE | ||||
|
r391 | class LineChartAnimatator; | ||
|
r131 | |||
|
r145 | class LineChartAnimationItem : public LineChartItem { | ||
|
r389 | |||
|
r391 | Q_OBJECT | ||
|
r131 | public: | ||
|
r439 | LineChartAnimationItem(QLineSeries *series, QGraphicsItem *parent = 0); | ||
|
r131 | virtual ~LineChartAnimationItem(); | ||
|
r391 | protected: | ||
|
r465 | virtual void updatePoints(QVector<QPointF>& newPoints); | ||
|
r464 | virtual void updatePoint(int index,QPointF& newPoint); | ||
|
r391 | |||
private slots: | ||||
void startAnimation(); | ||||
|
r131 | |||
private: | ||||
|
r391 | LineChartAnimatator *m_animation; | ||
QVector<QPointF> m_points; | ||||
bool m_dirty; | ||||
|
r131 | }; | ||
|
r389 | class LineChartAnimatator: public QVariantAnimation | ||
|
r131 | { | ||
public: | ||||
|
r391 | LineChartAnimatator(LineChartAnimationItem *item, QObject *parent = 0 ); | ||
~LineChartAnimatator(); | ||||
|
r389 | |||
|
r391 | protected: | ||
QVariant interpolated(const QVariant &start, const QVariant & end, qreal progress ) const; | ||||
void updateCurrentValue (const QVariant & value ); | ||||
private: | ||||
|
r131 | LineChartAnimationItem* m_item; | ||
}; | ||||
QTCOMMERCIALCHART_END_NAMESPACE | ||||
|
r145 | #endif | ||