diff options
author | sauimone <samu.uimonen@digia.com> | 2012-07-11 16:54:54 +0300 |
---|---|---|
committer | sauimone <samu.uimonen@digia.com> | 2012-07-11 16:55:27 +0300 |
commit | 77439ba7636185d868b990c4897960394c0e5c92 (patch) | |
tree | f04ed2f3cf4f00734dd4e1df3622fcb70c8c26a4 /src/animations | |
parent | 73e46ffc00f99087522d43b53ab01aafb00fd2e2 (diff) |
horizontal barchart & example
Diffstat (limited to 'src/animations')
-rw-r--r-- | src/animations/animations.pri | 6 | ||||
-rw-r--r-- | src/animations/horizontalbaranimation.cpp | 51 | ||||
-rw-r--r-- | src/animations/horizontalbaranimation_p.h | 52 |
3 files changed, 107 insertions, 2 deletions
diff --git a/src/animations/animations.pri b/src/animations/animations.pri index 783236f9..67c2908a 100644 --- a/src/animations/animations.pri +++ b/src/animations/animations.pri @@ -11,7 +11,8 @@ SOURCES += \ $$PWD/baranimation.cpp \ $$PWD/stackedbaranimation.cpp \ $$PWD/percentbaranimation.cpp \ - $$PWD/abstractbaranimation.cpp + $$PWD/abstractbaranimation.cpp \ + $$PWD/horizontalbaranimation.cpp PRIVATE_HEADERS += \ @@ -25,4 +26,5 @@ PRIVATE_HEADERS += \ $$PWD/baranimation_p.h \ $$PWD/stackedbaranimation_p.h \ $$PWD/percentbaranimation_p.h \ - $$PWD/abstractbaranimation_p.h + $$PWD/abstractbaranimation_p.h \ + $$PWD/horizontalbaranimation_p.h diff --git a/src/animations/horizontalbaranimation.cpp b/src/animations/horizontalbaranimation.cpp new file mode 100644 index 00000000..250561de --- /dev/null +++ b/src/animations/horizontalbaranimation.cpp @@ -0,0 +1,51 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Digia Plc +** All rights reserved. +** For any questions to Digia, please use contact form at http://qt.digia.com +** +** This file is part of the Qt Commercial Charts Add-on. +** +** $QT_BEGIN_LICENSE$ +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. +** +** If you have questions regarding the use of this file, please use +** contact form at http://qt.digia.com +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "horizontalbaranimation_p.h" +#include "abstractbarchartitem_p.h" +#include <QTimer> + +Q_DECLARE_METATYPE(QVector<QRectF>) + +QTCOMMERCIALCHART_BEGIN_NAMESPACE + +HorizontalBarAnimation::HorizontalBarAnimation(AbstractBarChartItem *item) : + AbstractBarAnimation(item) +{ +} + +HorizontalBarAnimation::~HorizontalBarAnimation() +{ + +} + + +QVariant HorizontalBarAnimation::interpolated(const QVariant &from, const QVariant &to, qreal progress) const +{ + // TODO: + Q_UNUSED(from); + Q_UNUSED(to); + Q_UNUSED(progress); + return to; +} + +#include "moc_horizontalbaranimation_p.cpp" + +QTCOMMERCIALCHART_END_NAMESPACE diff --git a/src/animations/horizontalbaranimation_p.h b/src/animations/horizontalbaranimation_p.h new file mode 100644 index 00000000..9c8438b3 --- /dev/null +++ b/src/animations/horizontalbaranimation_p.h @@ -0,0 +1,52 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Digia Plc +** All rights reserved. +** For any questions to Digia, please use contact form at http://qt.digia.com +** +** This file is part of the Qt Commercial Charts Add-on. +** +** $QT_BEGIN_LICENSE$ +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. +** +** If you have questions regarding the use of this file, please use +** contact form at http://qt.digia.com +** $QT_END_LICENSE$ +** +****************************************************************************/ + +// W A R N I N G +// ------------- +// +// This file is not part of the QtCommercial Chart API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. + +#ifndef HORIZONTALBARANIMATION_P_H +#define HORIZONTALBARANIMATION_P_H + +#include "abstractbaranimation_p.h" +#include "chartanimation_p.h" +#include "abstractbarchartitem_p.h" + +QTCOMMERCIALCHART_BEGIN_NAMESPACE + +class HorizontalBarAnimation : public AbstractBarAnimation +{ + Q_OBJECT +public: + explicit HorizontalBarAnimation(AbstractBarChartItem *item); + ~HorizontalBarAnimation(); + + virtual QVariant interpolated(const QVariant &from, const QVariant &to, qreal progress) const; + +}; + +QTCOMMERCIALCHART_END_NAMESPACE + +#endif // HORIZONTALBARANIMATION_P_H |