diff options
author | Christian Ehrlicher <ch.ehrlicher@gmx.de> | 2018-12-07 14:15:36 +0100 |
---|---|---|
committer | Christian Ehrlicher <ch.ehrlicher@gmx.de> | 2019-01-06 17:08:03 +0000 |
commit | 8cf812231405e011b422a1505d9a219618fe5cee (patch) | |
tree | 99603ff6fd301dfbdc8104fd0b470d3b9aa3262c /examples/widgets/animation/sub-attaq/submarine.cpp | |
parent | cf27d9e8a5e14ebe083f4b0fa2204d0646e7ed5e (diff) |
Cleanup Widgets examples - new signal/slot syntax
Cleanup the Widget examples - use the new signal/slot syntax where
possible - animation, effects and graphicsview subdirectory
Change-Id: I6cbaea6e628eb06f8e0ca6a0b795030a66b83878
Reviewed-by: Luca Beldi <v.ronin@yahoo.it>
Reviewed-by: Topi Reiniƶ <topi.reinio@qt.io>
Diffstat (limited to 'examples/widgets/animation/sub-attaq/submarine.cpp')
-rw-r--r-- | examples/widgets/animation/sub-attaq/submarine.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/examples/widgets/animation/sub-attaq/submarine.cpp b/examples/widgets/animation/sub-attaq/submarine.cpp index a451185ce0..775e75ceed 100644 --- a/examples/widgets/animation/sub-attaq/submarine.cpp +++ b/examples/widgets/animation/sub-attaq/submarine.cpp @@ -106,7 +106,7 @@ SubMarine::SubMarine(int type, const QString &name, int points) : PixmapItem(QSt //This is the initial state of the moving root state moving->setInitialState(movement); - movement->addTransition(this, SIGNAL(subMarineStateChanged()), moving); + movement->addTransition(this, &SubMarine::subMarineStateChanged, moving); //This is the initial state of the machine machine->setInitialState(moving); @@ -115,23 +115,23 @@ SubMarine::SubMarine(int type, const QString &name, int points) : PixmapItem(QSt QFinalState *final = new QFinalState(machine); //If the moving animation is finished we move to the return state - movement->addTransition(movement, SIGNAL(animationFinished()), rotation); + movement->addTransition(movement, &QAnimationState::animationFinished, rotation); //If the return animation is finished we move to the moving state - rotation->addTransition(rotation, SIGNAL(animationFinished()), movement); + rotation->addTransition(rotation, &QAnimationState::animationFinished, movement); //This state play the destroyed animation QAnimationState *destroyedState = new QAnimationState(machine); destroyedState->setAnimation(setupDestroyAnimation(this)); //Play a nice animation when the submarine is destroyed - moving->addTransition(this, SIGNAL(subMarineDestroyed()), destroyedState); + moving->addTransition(this, &SubMarine::subMarineDestroyed, 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 submarine is dead - connect(machine,SIGNAL(finished()),this, SIGNAL(subMarineExecutionFinished())); + connect(machine,&QState::finished,this, &SubMarine::subMarineExecutionFinished); machine->start(); } |