summaryrefslogtreecommitdiffstats
path: root/examples/animation/animatedtiles
diff options
context:
space:
mode:
authorLeonardo Sobral Cunha <leo.cunha@nokia.com>2009-09-25 09:28:20 (GMT)
committerLeonardo Sobral Cunha <leo.cunha@nokia.com>2009-09-25 09:29:10 (GMT)
commit67e729c03db7c2f4e1e3e12a859bb9d2c0db2b5a (patch)
treed71d5773be56195bad1ce9faa11d45ff0266f8fa /examples/animation/animatedtiles
parentaf76d1bed8becfcf05dc9f901714575d26433ae9 (diff)
downloadQt-67e729c03db7c2f4e1e3e12a859bb9d2c0db2b5a.zip
Qt-67e729c03db7c2f4e1e3e12a859bb9d2c0db2b5a.tar.gz
Qt-67e729c03db7c2f4e1e3e12a859bb9d2c0db2b5a.tar.bz2
Reuse animation in animatedTiles example
Reviewed-by: trustme
Diffstat (limited to 'examples/animation/animatedtiles')
-rw-r--r--examples/animation/animatedtiles/main.cpp34
1 files changed, 4 insertions, 30 deletions
diff --git a/examples/animation/animatedtiles/main.cpp b/examples/animation/animatedtiles/main.cpp
index ca52f47..74164d3 100644
--- a/examples/animation/animatedtiles/main.cpp
+++ b/examples/animation/animatedtiles/main.cpp
@@ -228,51 +228,25 @@ int main(int argc, char **argv)
QAbstractTransition *trans = rootState->addTransition(ellipseButton, SIGNAL(pressed()), ellipseState);
trans->addAnimation(group);
- group = new QParallelAnimationGroup;
- for (int i = 0; i < items.count(); ++i) {
- QPropertyAnimation *anim = new QPropertyAnimation(items[i], "pos");
- anim->setDuration(750 + i * 25);
- anim->setEasingCurve(QEasingCurve::InOutBack);
- group->addAnimation(anim);
- }
trans = rootState->addTransition(figure8Button, SIGNAL(pressed()), figure8State);
trans->addAnimation(group);
- group = new QParallelAnimationGroup;
- for (int i = 0; i < items.count(); ++i) {
- QPropertyAnimation *anim = new QPropertyAnimation(items[i], "pos");
- anim->setDuration(750 + i * 25);
- anim->setEasingCurve(QEasingCurve::InOutBack);
- group->addAnimation(anim);
- }
trans = rootState->addTransition(randomButton, SIGNAL(pressed()), randomState);
trans->addAnimation(group);
- group = new QParallelAnimationGroup;
- for (int i = 0; i < items.count(); ++i) {
- QPropertyAnimation *anim = new QPropertyAnimation(items[i], "pos");
- anim->setDuration(750 + i * 25);
- anim->setEasingCurve(QEasingCurve::InOutBack);
- group->addAnimation(anim);
- }
trans = rootState->addTransition(tiledButton, SIGNAL(pressed()), tiledState);
trans->addAnimation(group);
- group = new QParallelAnimationGroup;
- for (int i = 0; i < items.count(); ++i) {
- QPropertyAnimation *anim = new QPropertyAnimation(items[i], "pos");
- anim->setDuration(750 + i * 25);
- anim->setEasingCurve(QEasingCurve::InOutBack);
- group->addAnimation(anim);
- }
trans = rootState->addTransition(centeredButton, SIGNAL(pressed()), centeredState);
trans->addAnimation(group);
- states.start();
QTimer timer;
timer.start(125);
timer.setSingleShot(true);
- rootState->addTransition(&timer, SIGNAL(timeout()), ellipseState);
+ trans = rootState->addTransition(&timer, SIGNAL(timeout()), ellipseState);
+ trans->addAnimation(group);
+
+ states.start();
#ifdef QT_KEYPAD_NAVIGATION
QApplication::setNavigationMode(Qt::NavigationModeCursorAuto);