##// END OF EJS Templates
Warnings are errors
Tero Ahola -
r672:8120c81074de
parent child
Show More
@@ -1,49 +1,49
1 #include "baranimation_p.h"
1 #include "baranimation_p.h"
2 #include "barchartitem_p.h"
2 #include "barchartitem_p.h"
3 #include <QParallelAnimationGroup>
3 #include <QParallelAnimationGroup>
4 #include <QTimer>
4 #include <QTimer>
5
5
6 Q_DECLARE_METATYPE(QVector<QSizeF>)
6 Q_DECLARE_METATYPE(QVector<QSizeF>)
7
7
8 QTCOMMERCIALCHART_BEGIN_NAMESPACE
8 QTCOMMERCIALCHART_BEGIN_NAMESPACE
9
9
10 BarAnimation::BarAnimation(BarChartItem *item)
10 BarAnimation::BarAnimation(BarChartItem *item)
11 :ChartAnimation(item),
11 :ChartAnimation(item),
12 m_item(item)
12 m_item(item)
13 {
13 {
14 }
14 }
15
15
16 BarAnimation::~BarAnimation()
16 BarAnimation::~BarAnimation()
17 {
17 {
18 }
18 }
19
19
20 void BarAnimation::updateValues(const BarLayout& layout)
20 void BarAnimation::updateValues(const BarLayout& /*layout*/)
21 {
21 {
22 // TODO:
22 // TODO:
23 qDebug() << "BarAnimation::updateValues";
23 qDebug() << "BarAnimation::updateValues";
24 }
24 }
25
25
26
26
27 QVariant BarAnimation::interpolated(const QVariant &from, const QVariant &to, qreal progress) const
27 QVariant BarAnimation::interpolated(const QVariant &from, const QVariant &to, qreal progress) const
28 {
28 {
29 QVector<QSizeF> startVector = qVariantValue<QVector<QSizeF> > (from);
29 QVector<QSizeF> startVector = qVariantValue<QVector<QSizeF> > (from);
30 QVector<QSizeF> endVector = qVariantValue<QVector<QSizeF> > (to);
30 QVector<QSizeF> endVector = qVariantValue<QVector<QSizeF> > (to);
31 QVector<QSizeF> result;
31 QVector<QSizeF> result;
32
32
33 Q_ASSERT(startVector.count() == endVector.count()) ;
33 Q_ASSERT(startVector.count() == endVector.count()) ;
34
34
35 for(int i =0 ;i< startVector.count();i++){
35 for(int i =0 ;i< startVector.count();i++){
36 QSizeF value = startVector[i] + ((endVector[i]- endVector[i]) * progress);
36 QSizeF value = startVector[i] + ((endVector[i]- endVector[i]) * progress);
37 result << value;
37 result << value;
38 }
38 }
39 return qVariantFromValue(result);
39 return qVariantFromValue(result);
40 }
40 }
41
41
42 void BarAnimation::updateCurrentValue(const QVariant &)
42 void BarAnimation::updateCurrentValue(const QVariant &)
43 {
43 {
44 // TODO?
44 // TODO?
45 }
45 }
46
46
47 #include "moc_baranimation_p.cpp"
47 #include "moc_baranimation_p.cpp"
48
48
49 QTCOMMERCIALCHART_END_NAMESPACE
49 QTCOMMERCIALCHART_END_NAMESPACE
General Comments 0
You need to be logged in to leave comments. Login now