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