##// END OF EJS Templates
Refactors chartitem...
Refactors chartitem * new base chart * unify all series constructors

File last commit:

r672:8120c81074de
r677:2b967c4f6e8e
Show More
baranimation.cpp
49 lines | 1.1 KiB | text/x-c | CppLexer
#include "baranimation_p.h"
#include "barchartitem_p.h"
#include <QParallelAnimationGroup>
#include <QTimer>
Q_DECLARE_METATYPE(QVector<QSizeF>)
QTCOMMERCIALCHART_BEGIN_NAMESPACE
BarAnimation::BarAnimation(BarChartItem *item)
:ChartAnimation(item),
m_item(item)
{
}
BarAnimation::~BarAnimation()
{
}
void BarAnimation::updateValues(const BarLayout& /*layout*/)
{
// TODO:
qDebug() << "BarAnimation::updateValues";
}
QVariant BarAnimation::interpolated(const QVariant &from, const QVariant &to, qreal progress) const
{
QVector<QSizeF> startVector = qVariantValue<QVector<QSizeF> > (from);
QVector<QSizeF> endVector = qVariantValue<QVector<QSizeF> > (to);
QVector<QSizeF> result;
Q_ASSERT(startVector.count() == endVector.count()) ;
for(int i =0 ;i< startVector.count();i++){
QSizeF value = startVector[i] + ((endVector[i]- endVector[i]) * progress);
result << value;
}
return qVariantFromValue(result);
}
void BarAnimation::updateCurrentValue(const QVariant &)
{
// TODO?
}
#include "moc_baranimation_p.cpp"
QTCOMMERCIALCHART_END_NAMESPACE