summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
Diffstat (limited to 'examples')
-rw-r--r--examples/animation/states/main.cpp135
1 files changed, 63 insertions, 72 deletions
diff --git a/examples/animation/states/main.cpp b/examples/animation/states/main.cpp
index dafa8ad..85e28e1 100644
--- a/examples/animation/states/main.cpp
+++ b/examples/animation/states/main.cpp
@@ -194,83 +194,74 @@ int main(int argc, char *argv[])
state3->assignProperty(p5, "opacity", qreal(1));
state3->assignProperty(p6, "opacity", qreal(1));
- QParallelAnimationGroup animation1;
-
- QSequentialAnimationGroup *animation1SubGroup;
- animation1SubGroup = new QSequentialAnimationGroup(&animation1);
+ QAbstractTransition *t1 = state1->addTransition(button, SIGNAL(clicked()), state2);
+ QSequentialAnimationGroup *animation1SubGroup = new QSequentialAnimationGroup;
animation1SubGroup->addPause(250);
animation1SubGroup->addAnimation(new QPropertyAnimation(box, "geometry"));
+ t1->addAnimation(animation1SubGroup);
+ t1->addAnimation(new QPropertyAnimation(widget, "geometry"));
+ t1->addAnimation(new QPropertyAnimation(p1, "geometry"));
+ t1->addAnimation(new QPropertyAnimation(p2, "geometry"));
+ t1->addAnimation(new QPropertyAnimation(p3, "geometry"));
+ t1->addAnimation(new QPropertyAnimation(p4, "geometry"));
+ t1->addAnimation(new QPropertyAnimation(p5, "geometry"));
+ t1->addAnimation(new QPropertyAnimation(p6, "geometry"));
+ t1->addAnimation(new QPropertyAnimation(p1, "rotation"));
+ t1->addAnimation(new QPropertyAnimation(p2, "rotation"));
+ t1->addAnimation(new QPropertyAnimation(p3, "rotation"));
+ t1->addAnimation(new QPropertyAnimation(p4, "rotation"));
+ t1->addAnimation(new QPropertyAnimation(p5, "rotation"));
+ t1->addAnimation(new QPropertyAnimation(p6, "rotation"));
+ t1->addAnimation(new QPropertyAnimation(p1, "opacity"));
+ t1->addAnimation(new QPropertyAnimation(p2, "opacity"));
+ t1->addAnimation(new QPropertyAnimation(p3, "opacity"));
+ t1->addAnimation(new QPropertyAnimation(p4, "opacity"));
+ t1->addAnimation(new QPropertyAnimation(p5, "opacity"));
+ t1->addAnimation(new QPropertyAnimation(p6, "opacity"));
- animation1.addAnimation(new QPropertyAnimation(widget, "geometry"));
- animation1.addAnimation(new QPropertyAnimation(p1, "geometry"));
- animation1.addAnimation(new QPropertyAnimation(p2, "geometry"));
- animation1.addAnimation(new QPropertyAnimation(p3, "geometry"));
- animation1.addAnimation(new QPropertyAnimation(p4, "geometry"));
- animation1.addAnimation(new QPropertyAnimation(p5, "geometry"));
- animation1.addAnimation(new QPropertyAnimation(p6, "geometry"));
- animation1.addAnimation(new QPropertyAnimation(p1, "rotation"));
- animation1.addAnimation(new QPropertyAnimation(p2, "rotation"));
- animation1.addAnimation(new QPropertyAnimation(p3, "rotation"));
- animation1.addAnimation(new QPropertyAnimation(p4, "rotation"));
- animation1.addAnimation(new QPropertyAnimation(p5, "rotation"));
- animation1.addAnimation(new QPropertyAnimation(p6, "rotation"));
- animation1.addAnimation(new QPropertyAnimation(p1, "opacity"));
- animation1.addAnimation(new QPropertyAnimation(p2, "opacity"));
- animation1.addAnimation(new QPropertyAnimation(p3, "opacity"));
- animation1.addAnimation(new QPropertyAnimation(p4, "opacity"));
- animation1.addAnimation(new QPropertyAnimation(p5, "opacity"));
- animation1.addAnimation(new QPropertyAnimation(p6, "opacity"));
-
- QParallelAnimationGroup animation2;
- animation2.addAnimation(new QPropertyAnimation(box, "geometry"));
- animation2.addAnimation(new QPropertyAnimation(widget, "geometry"));
- animation2.addAnimation(new QPropertyAnimation(p1, "geometry"));
- animation2.addAnimation(new QPropertyAnimation(p2, "geometry"));
- animation2.addAnimation(new QPropertyAnimation(p3, "geometry"));
- animation2.addAnimation(new QPropertyAnimation(p4, "geometry"));
- animation2.addAnimation(new QPropertyAnimation(p5, "geometry"));
- animation2.addAnimation(new QPropertyAnimation(p6, "geometry"));
- animation2.addAnimation(new QPropertyAnimation(p1, "rotation"));
- animation2.addAnimation(new QPropertyAnimation(p2, "rotation"));
- animation2.addAnimation(new QPropertyAnimation(p3, "rotation"));
- animation2.addAnimation(new QPropertyAnimation(p4, "rotation"));
- animation2.addAnimation(new QPropertyAnimation(p5, "rotation"));
- animation2.addAnimation(new QPropertyAnimation(p6, "rotation"));
- animation2.addAnimation(new QPropertyAnimation(p1, "opacity"));
- animation2.addAnimation(new QPropertyAnimation(p2, "opacity"));
- animation2.addAnimation(new QPropertyAnimation(p3, "opacity"));
- animation2.addAnimation(new QPropertyAnimation(p4, "opacity"));
- animation2.addAnimation(new QPropertyAnimation(p5, "opacity"));
- animation2.addAnimation(new QPropertyAnimation(p6, "opacity"));
-
- QParallelAnimationGroup animation3;
- animation3.addAnimation(new QPropertyAnimation(box, "geometry"));
- animation3.addAnimation(new QPropertyAnimation(widget, "geometry"));
- animation3.addAnimation(new QPropertyAnimation(p1, "geometry"));
- animation3.addAnimation(new QPropertyAnimation(p2, "geometry"));
- animation3.addAnimation(new QPropertyAnimation(p3, "geometry"));
- animation3.addAnimation(new QPropertyAnimation(p4, "geometry"));
- animation3.addAnimation(new QPropertyAnimation(p5, "geometry"));
- animation3.addAnimation(new QPropertyAnimation(p6, "geometry"));
- animation3.addAnimation(new QPropertyAnimation(p1, "rotation"));
- animation3.addAnimation(new QPropertyAnimation(p2, "rotation"));
- animation3.addAnimation(new QPropertyAnimation(p3, "rotation"));
- animation3.addAnimation(new QPropertyAnimation(p4, "rotation"));
- animation3.addAnimation(new QPropertyAnimation(p5, "rotation"));
- animation3.addAnimation(new QPropertyAnimation(p6, "rotation"));
- animation3.addAnimation(new QPropertyAnimation(p1, "opacity"));
- animation3.addAnimation(new QPropertyAnimation(p2, "opacity"));
- animation3.addAnimation(new QPropertyAnimation(p3, "opacity"));
- animation3.addAnimation(new QPropertyAnimation(p4, "opacity"));
- animation3.addAnimation(new QPropertyAnimation(p5, "opacity"));
- animation3.addAnimation(new QPropertyAnimation(p6, "opacity"));
-
- QAbstractTransition *t1 = state1->addTransition(button, SIGNAL(clicked()), state2);
- t1->addAnimation(&animation1);
QAbstractTransition *t2 = state2->addTransition(button, SIGNAL(clicked()), state3);
- t2->addAnimation(&animation2);
+ t2->addAnimation(new QPropertyAnimation(box, "geometry"));
+ t2->addAnimation(new QPropertyAnimation(widget, "geometry"));
+ t2->addAnimation(new QPropertyAnimation(p1, "geometry"));
+ t2->addAnimation(new QPropertyAnimation(p2, "geometry"));
+ t2->addAnimation(new QPropertyAnimation(p3, "geometry"));
+ t2->addAnimation(new QPropertyAnimation(p4, "geometry"));
+ t2->addAnimation(new QPropertyAnimation(p5, "geometry"));
+ t2->addAnimation(new QPropertyAnimation(p6, "geometry"));
+ t2->addAnimation(new QPropertyAnimation(p1, "rotation"));
+ t2->addAnimation(new QPropertyAnimation(p2, "rotation"));
+ t2->addAnimation(new QPropertyAnimation(p3, "rotation"));
+ t2->addAnimation(new QPropertyAnimation(p4, "rotation"));
+ t2->addAnimation(new QPropertyAnimation(p5, "rotation"));
+ t2->addAnimation(new QPropertyAnimation(p6, "rotation"));
+ t2->addAnimation(new QPropertyAnimation(p1, "opacity"));
+ t2->addAnimation(new QPropertyAnimation(p2, "opacity"));
+ t2->addAnimation(new QPropertyAnimation(p3, "opacity"));
+ t2->addAnimation(new QPropertyAnimation(p4, "opacity"));
+ t2->addAnimation(new QPropertyAnimation(p5, "opacity"));
+ t2->addAnimation(new QPropertyAnimation(p6, "opacity"));
+
QAbstractTransition *t3 = state3->addTransition(button, SIGNAL(clicked()), state1);
- t3->addAnimation(&animation3);
+ t3->addAnimation(new QPropertyAnimation(box, "geometry"));
+ t3->addAnimation(new QPropertyAnimation(widget, "geometry"));
+ t3->addAnimation(new QPropertyAnimation(p1, "geometry"));
+ t3->addAnimation(new QPropertyAnimation(p2, "geometry"));
+ t3->addAnimation(new QPropertyAnimation(p3, "geometry"));
+ t3->addAnimation(new QPropertyAnimation(p4, "geometry"));
+ t3->addAnimation(new QPropertyAnimation(p5, "geometry"));
+ t3->addAnimation(new QPropertyAnimation(p6, "geometry"));
+ t3->addAnimation(new QPropertyAnimation(p1, "rotation"));
+ t3->addAnimation(new QPropertyAnimation(p2, "rotation"));
+ t3->addAnimation(new QPropertyAnimation(p3, "rotation"));
+ t3->addAnimation(new QPropertyAnimation(p4, "rotation"));
+ t3->addAnimation(new QPropertyAnimation(p5, "rotation"));
+ t3->addAnimation(new QPropertyAnimation(p6, "rotation"));
+ t3->addAnimation(new QPropertyAnimation(p1, "opacity"));
+ t3->addAnimation(new QPropertyAnimation(p2, "opacity"));
+ t3->addAnimation(new QPropertyAnimation(p3, "opacity"));
+ t3->addAnimation(new QPropertyAnimation(p4, "opacity"));
+ t3->addAnimation(new QPropertyAnimation(p5, "opacity"));
+ t3->addAnimation(new QPropertyAnimation(p6, "opacity"));
machine.start();