diff options
| author | David Boddie <dboddie@trolltech.com> | 2009-05-20 16:22:17 (GMT) | 
|---|---|---|
| committer | David Boddie <dboddie@trolltech.com> | 2009-05-20 16:22:17 (GMT) | 
| commit | bbd7c13d0cf9d99413f2bea9a3acfba848e3520e (patch) | |
| tree | e0e1feb1d84039f250a50e7c78065a3ecd2624fd /doc/src/snippets/animation/sequential/tracer.cpp | |
| parent | bdbe84f8a8dbb50873e26829ee8a5127e21a0161 (diff) | |
| download | Qt-bbd7c13d0cf9d99413f2bea9a3acfba848e3520e.zip Qt-bbd7c13d0cf9d99413f2bea9a3acfba848e3520e.tar.gz Qt-bbd7c13d0cf9d99413f2bea9a3acfba848e3520e.tar.bz2  | |
Doc: Added a small example/test case for sequential animations.
Reviewed-by: Trust Me
Diffstat (limited to 'doc/src/snippets/animation/sequential/tracer.cpp')
| -rw-r--r-- | doc/src/snippets/animation/sequential/tracer.cpp | 25 | 
1 files changed, 25 insertions, 0 deletions
diff --git a/doc/src/snippets/animation/sequential/tracer.cpp b/doc/src/snippets/animation/sequential/tracer.cpp new file mode 100644 index 0000000..49bd51e --- /dev/null +++ b/doc/src/snippets/animation/sequential/tracer.cpp @@ -0,0 +1,25 @@ +#include <QAbstractAnimation> +#include <QDebug> +#include <QPoint> +#include "tracer.h" + +Tracer::Tracer(QObject *parent) +    : QObject(parent) +{ +} + +void Tracer::checkValue() +{ +    QAbstractAnimation *animation = static_cast<QAbstractAnimation *>(sender()); +    if (time != animation->duration()) { +        qDebug() << "Animation's last recorded time" << time; +        qDebug() << "Expected" << animation->duration(); +    } +} + +void Tracer::recordValue(const QVariant &value) +{ +    QAbstractAnimation *animation = static_cast<QAbstractAnimation *>(sender()); +    this->value = value; +    time = animation->currentTime(); +}  | 
