##// END OF EJS Templates
Renamed SplinePresenter to SplineChartItem
Renamed SplinePresenter to SplineChartItem

File last commit:

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