summaryrefslogtreecommitdiffstats
path: root/examples/animation
diff options
context:
space:
mode:
authorThierry Bastian <thierry.bastian@nokia.com>2009-09-30 15:47:01 (GMT)
committerThierry Bastian <thierry.bastian@nokia.com>2009-09-30 16:04:02 (GMT)
commit5e107b788caa416068c64349ed23f8d82cb26785 (patch)
treec1104eb3c15ee2179290427687139ac168d23dab /examples/animation
parent2e16dff13d260e8ba07534b36ac635c9e625e442 (diff)
downloadQt-5e107b788caa416068c64349ed23f8d82cb26785.zip
Qt-5e107b788caa416068c64349ed23f8d82cb26785.tar.gz
Qt-5e107b788caa416068c64349ed23f8d82cb26785.tar.bz2
Avoid warnings in the states example
We now have the animations directly added to the transition
Diffstat (limited to 'examples/animation')
-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();