summaryrefslogtreecommitdiffstats
path: root/doc/src/snippets/animation/sequential/tracer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'doc/src/snippets/animation/sequential/tracer.cpp')
-rw-r--r--doc/src/snippets/animation/sequential/tracer.cpp25
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();
+}