##// END OF EJS Templates
Adds updated handling for line series
Adds updated handling for line series

File last commit:

r391:7d2e92012cfd
r392:938f3d3eaf7c
Show More
linechartanimationitem_p.h
50 lines | 1.2 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(ChartPresenter* presenter, 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