29 QPushButton *button =
new QPushButton(tr(
"Animated Button"),
this);
30 QPropertyAnimation *anim =
new QPropertyAnimation(button,
"pos",
this);
31 anim->setDuration(10000);
32 anim->setStartValue(QPoint(0, 0));
33 anim->setEndValue(QPoint(100, 250));
40 QPushButton *button =
new QPushButton(tr(
"Animated Button"),
this);
41 QPropertyAnimation *anim =
new QPropertyAnimation(button,
"pos",
this);
42 anim->setDuration(10000);
43 anim->setStartValue(QPoint(0, 0));
44 anim->setEndValue(QPoint(100, 250));
45 anim->setEasingCurve(QEasingCurve::OutBounce);
52 QPushButton *bonnie =
new QPushButton(tr(
"Bonnie"),
this);
53 QPushButton *clyde =
new QPushButton(tr(
"Clyde"),
this);
55 QPropertyAnimation *anim1 =
new QPropertyAnimation(bonnie,
"pos",
this);
56 anim1->setDuration(3000);
57 anim1->setStartValue(QPoint(0, 0));
58 anim1->setEndValue(QPoint(100, 250));
60 QPropertyAnimation *anim2 =
new QPropertyAnimation(clyde,
"pos",
this);
61 anim2->setDuration(3000);
62 anim2->setStartValue(QPoint(100, 250));
63 anim2->setEndValue(QPoint(500, 500));
65 QParallelAnimationGroup *parallelAnim =
new QParallelAnimationGroup;
66 parallelAnim->addAnimation(anim1);
67 parallelAnim->addAnimation(anim2);
68 parallelAnim->start();
74 QPushButton *bonnie =
new QPushButton(tr(
"Bonnie"),
this);
75 QPushButton *clyde =
new QPushButton(tr(
"Clyde"),
this);
77 QPropertyAnimation *anim1 =
new QPropertyAnimation(bonnie,
"pos",
this);
78 anim1->setDuration(3000);
79 anim1->setStartValue(QPoint(0, 0));
80 anim1->setEndValue(QPoint(100, 250));
82 QPropertyAnimation *anim2 =
new QPropertyAnimation(clyde,
"pos",
this);
83 anim2->setDuration(3000);
84 anim2->setStartValue(QPoint(0, 0));
85 anim2->setEndValue(QPoint(200, 250));
87 QSequentialAnimationGroup *sequenceAnim =
new QSequentialAnimationGroup;
88 sequenceAnim->addAnimation(anim1);
89 sequenceAnim->addAnimation(anim2);
90 sequenceAnim->start();