diff options
author | Kent Hansen <khansen@trolltech.com> | 2009-05-22 12:09:21 (GMT) |
---|---|---|
committer | Kent Hansen <khansen@trolltech.com> | 2009-05-22 12:09:21 (GMT) |
commit | 64cc2368d230c6f0996a6311767bd1704b4cf322 (patch) | |
tree | 7082cfb21a22c702b978db0daf93ddff03fb836b /doc/src/snippets | |
parent | 7c00cc50fc41a7c7b9c04e258a9eb03ff187c574 (diff) | |
download | Qt-64cc2368d230c6f0996a6311767bd1704b4cf322.zip Qt-64cc2368d230c6f0996a6311767bd1704b4cf322.tar.gz Qt-64cc2368d230c6f0996a6311767bd1704b4cf322.tar.bz2 |
Revert "Say hello to animation API & state machine API"
This reverts commit 1a709fbe25a2446a9b311ded88aec5565258f3ac.
Diffstat (limited to 'doc/src/snippets')
-rw-r--r-- | doc/src/snippets/animation/sequential/icons.qrc | 6 | ||||
-rw-r--r-- | doc/src/snippets/animation/sequential/icons/left.png | bin | 413 -> 0 bytes | |||
-rw-r--r-- | doc/src/snippets/animation/sequential/icons/right.png | bin | 414 -> 0 bytes | |||
-rw-r--r-- | doc/src/snippets/animation/sequential/main.cpp | 50 | ||||
-rw-r--r-- | doc/src/snippets/animation/sequential/sequential.pro | 4 | ||||
-rw-r--r-- | doc/src/snippets/animation/sequential/tracer.cpp | 25 | ||||
-rw-r--r-- | doc/src/snippets/animation/sequential/tracer.h | 23 | ||||
-rw-r--r-- | doc/src/snippets/code/src_corelib_tools_qeasingcurve.cpp | 4 |
8 files changed, 0 insertions, 112 deletions
diff --git a/doc/src/snippets/animation/sequential/icons.qrc b/doc/src/snippets/animation/sequential/icons.qrc deleted file mode 100644 index d55f797..0000000 --- a/doc/src/snippets/animation/sequential/icons.qrc +++ /dev/null @@ -1,6 +0,0 @@ -<!DOCTYPE RCC><RCC version="1.0"> - <qresource> - <file>icons/left.png</file> - <file>icons/right.png</file> - </qresource> -</RCC> diff --git a/doc/src/snippets/animation/sequential/icons/left.png b/doc/src/snippets/animation/sequential/icons/left.png Binary files differdeleted file mode 100644 index 5dd8da0..0000000 --- a/doc/src/snippets/animation/sequential/icons/left.png +++ /dev/null diff --git a/doc/src/snippets/animation/sequential/icons/right.png b/doc/src/snippets/animation/sequential/icons/right.png Binary files differdeleted file mode 100644 index ac61326..0000000 --- a/doc/src/snippets/animation/sequential/icons/right.png +++ /dev/null diff --git a/doc/src/snippets/animation/sequential/main.cpp b/doc/src/snippets/animation/sequential/main.cpp deleted file mode 100644 index aff8f29..0000000 --- a/doc/src/snippets/animation/sequential/main.cpp +++ /dev/null @@ -1,50 +0,0 @@ -#include <QApplication> -#include <QLabel> -#include <QPropertyAnimation> -#include <QSequentialAnimationGroup> -#include "tracer.h" - -int main(int argc, char *argv[]) -{ - QApplication app(argc, argv); - - QWidget window; - window.resize(720, 96); - window.show(); - - QLabel *label1 = new QLabel(&window); - label1->setPixmap(QPixmap(":/icons/left.png")); - label1->move(16, 16); - label1->show(); - - QLabel *label2 = new QLabel(&window); - label2->setPixmap(QPixmap(":/icons/right.png")); - label2->move(320, 16); - label2->show(); - - QPropertyAnimation *anim1 = new QPropertyAnimation(label1, "pos"); - anim1->setDuration(2500); - anim1->setStartValue(QPoint(16, 16)); - anim1->setEndValue(QPoint(320, 16)); - - QPropertyAnimation *anim2 = new QPropertyAnimation(label2, "pos"); - anim2->setDuration(2500); - anim2->setStartValue(QPoint(320, 16)); - anim2->setEndValue(QPoint(640, 16)); - - QSequentialAnimationGroup group; - group.addAnimation(anim1); - group.addAnimation(anim2); - - Tracer tracer(&window); - - QObject::connect(anim1, SIGNAL(valueChanged(QVariant)), - &tracer, SLOT(recordValue(QVariant))); - QObject::connect(anim2, SIGNAL(valueChanged(QVariant)), - &tracer, SLOT(recordValue(QVariant))); - QObject::connect(anim1, SIGNAL(finished()), &tracer, SLOT(checkValue())); - QObject::connect(anim2, SIGNAL(finished()), &tracer, SLOT(checkValue())); - - group.start(); - return app.exec(); -} diff --git a/doc/src/snippets/animation/sequential/sequential.pro b/doc/src/snippets/animation/sequential/sequential.pro deleted file mode 100644 index fcf017f..0000000 --- a/doc/src/snippets/animation/sequential/sequential.pro +++ /dev/null @@ -1,4 +0,0 @@ -HEADERS = tracer.h -RESOURCES = icons.qrc -SOURCES = main.cpp \ - tracer.cpp diff --git a/doc/src/snippets/animation/sequential/tracer.cpp b/doc/src/snippets/animation/sequential/tracer.cpp deleted file mode 100644 index 49bd51e..0000000 --- a/doc/src/snippets/animation/sequential/tracer.cpp +++ /dev/null @@ -1,25 +0,0 @@ -#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(); -} diff --git a/doc/src/snippets/animation/sequential/tracer.h b/doc/src/snippets/animation/sequential/tracer.h deleted file mode 100644 index 1adb018..0000000 --- a/doc/src/snippets/animation/sequential/tracer.h +++ /dev/null @@ -1,23 +0,0 @@ -#ifndef TRACER_H -#define TRACER_H - -#include <QObject> -#include <QVariant> - -class Tracer : public QObject -{ - Q_OBJECT - -public: - Tracer(QObject *parent = 0); - -public slots: - void checkValue(); - void recordValue(const QVariant &value); - -private: - QVariant value; - int time; -}; - -#endif diff --git a/doc/src/snippets/code/src_corelib_tools_qeasingcurve.cpp b/doc/src/snippets/code/src_corelib_tools_qeasingcurve.cpp deleted file mode 100644 index 65358ea..0000000 --- a/doc/src/snippets/code/src_corelib_tools_qeasingcurve.cpp +++ /dev/null @@ -1,4 +0,0 @@ -//! [0] -qreal myEasingFunction(qreal progress); -//! [0] - |