diff options
Diffstat (limited to 'examples/widgets/animation/sub-attaq/boat.cpp')
-rw-r--r-- | examples/widgets/animation/sub-attaq/boat.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/examples/widgets/animation/sub-attaq/boat.cpp b/examples/widgets/animation/sub-attaq/boat.cpp index 145d373e99..9037d54878 100644 --- a/examples/widgets/animation/sub-attaq/boat.cpp +++ b/examples/widgets/animation/sub-attaq/boat.cpp @@ -92,8 +92,9 @@ static QAbstractAnimation *setupDestroyAnimation(Boat *boat) -Boat::Boat() : PixmapItem(QString("boat"), GraphicsScene::Big), - speed(0), bombsAlreadyLaunched(0), direction(Boat::None), movementAnimation(0) +Boat::Boat() + : PixmapItem(QString("boat"), GraphicsScene::Big), + speed(0), bombsAlreadyLaunched(0), direction(Boat::None) { setZValue(4); setFlags(QGraphicsItem::ItemIsFocusable); @@ -148,8 +149,8 @@ Boat::Boat() : PixmapItem(QString("boat"), GraphicsScene::Big), stopState->addTransition(leftMoveStop); //The animation is finished, it means we reached the border of the screen, the boat is stopped so we move to the stop state - moveStateLeft->addTransition(movementAnimation, SIGNAL(finished()), stopState); - moveStateRight->addTransition(movementAnimation, SIGNAL(finished()), stopState); + moveStateLeft->addTransition(movementAnimation, &QAbstractAnimation::finished, stopState); + moveStateRight->addTransition(movementAnimation, &QAbstractAnimation::finished, stopState); //We set up the keys for dropping bombs KeyLaunchTransition *upFireLeft = new KeyLaunchTransition(this, QEvent::KeyPress, Qt::Key_Up); @@ -187,13 +188,13 @@ Boat::Boat() : PixmapItem(QString("boat"), GraphicsScene::Big), destroyedState->setAnimation(destroyAnimation); //Play a nice animation when the boat is destroyed - moving->addTransition(this, SIGNAL(boatDestroyed()), destroyedState); + moving->addTransition(this, &Boat::boatDestroyed, destroyedState); //Transition to final state when the destroyed animation is finished - destroyedState->addTransition(destroyedState, SIGNAL(animationFinished()), final); + destroyedState->addTransition(destroyedState, &QAnimationState::animationFinished, final); //The machine has finished to be executed, then the boat is dead - connect(machine,SIGNAL(finished()), this, SIGNAL(boatExecutionFinished())); + connect(machine,&QState::finished, this, &Boat::boatExecutionFinished); } |