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/torpedo.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/torpedo.cpp')
-rw-r--r-- | examples/widgets/animation/sub-attaq/torpedo.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/examples/widgets/animation/sub-attaq/torpedo.cpp b/examples/widgets/animation/sub-attaq/torpedo.cpp index 2e9d970326..5f8ef2f2b8 100644 --- a/examples/widgets/animation/sub-attaq/torpedo.cpp +++ b/examples/widgets/animation/sub-attaq/torpedo.cpp @@ -73,8 +73,8 @@ void Torpedo::launch() launchAnimation->setEndValue(QPointF(x(),qobject_cast<GraphicsScene *>(scene())->sealLevel() - 15)); launchAnimation->setEasingCurve(QEasingCurve::InQuad); launchAnimation->setDuration(y()/currentSpeed*10); - connect(launchAnimation,SIGNAL(valueChanged(QVariant)),this,SLOT(onAnimationLaunchValueChanged(QVariant))); - connect(this,SIGNAL(torpedoExploded()), launchAnimation, SLOT(stop())); + connect(launchAnimation,&QVariantAnimation::valueChanged,this,&Torpedo::onAnimationLaunchValueChanged); + connect(this,&Torpedo::torpedoExploded, launchAnimation, &QAbstractAnimation::stop); //We setup the state machine of the torpedo QStateMachine *machine = new QStateMachine(this); @@ -89,13 +89,13 @@ void Torpedo::launch() machine->setInitialState(launched); //### Add a nice animation when the torpedo is destroyed - launched->addTransition(this, SIGNAL(torpedoExploded()),final); + launched->addTransition(this, &Torpedo::torpedoExploded,final); //If the animation is finished, then we move to the final state - launched->addTransition(launched, SIGNAL(animationFinished()), final); + launched->addTransition(launched, &QAnimationState::animationFinished, final); //The machine has finished to be executed, then the boat is dead - connect(machine,SIGNAL(finished()),this, SIGNAL(torpedoExecutionFinished())); + connect(machine,&QState::finished,this, &Torpedo::torpedoExecutionFinished); machine->start(); } |