diff options
Diffstat (limited to 'examples/widgets/statemachine')
4 files changed, 14 insertions, 13 deletions
diff --git a/examples/widgets/statemachine/factorial/main.cpp b/examples/widgets/statemachine/factorial/main.cpp index f100aa0110..2d25822828 100644 --- a/examples/widgets/statemachine/factorial/main.cpp +++ b/examples/widgets/statemachine/factorial/main.cpp @@ -100,7 +100,7 @@ class FactorialLoopTransition : public QSignalTransition { public: FactorialLoopTransition(Factorial *fact) - : QSignalTransition(fact, SIGNAL(xChanged(int))), m_fact(fact) + : QSignalTransition(fact, &Factorial::xChanged), m_fact(fact) {} bool eventTest(QEvent *e) override @@ -130,7 +130,7 @@ class FactorialDoneTransition : public QSignalTransition { public: FactorialDoneTransition(Factorial *fact) - : QSignalTransition(fact, SIGNAL(xChanged(int))), m_fact(fact) + : QSignalTransition(fact, &Factorial::xChanged), m_fact(fact) {} bool eventTest(QEvent *e) override diff --git a/examples/widgets/statemachine/rogue/window.cpp b/examples/widgets/statemachine/rogue/window.cpp index 059fbf1003..f91a6e522e 100644 --- a/examples/widgets/statemachine/rogue/window.cpp +++ b/examples/widgets/statemachine/rogue/window.cpp @@ -217,7 +217,8 @@ void Window::buildMachine() //![5] machine->setInitialState(inputState); - connect(machine, SIGNAL(finished()), qApp, SLOT(quit())); + connect(machine, &QStateMachine::finished, + qApp, &QApplication::quit); machine->start(); } diff --git a/examples/widgets/statemachine/trafficlight/main.cpp b/examples/widgets/statemachine/trafficlight/main.cpp index 21df91d8b0..b348d4f65d 100644 --- a/examples/widgets/statemachine/trafficlight/main.cpp +++ b/examples/widgets/statemachine/trafficlight/main.cpp @@ -132,11 +132,11 @@ QState *createLightState(LightWidget *light, int duration, QState *parent = 0) timer->setInterval(duration); timer->setSingleShot(true); QState *timing = new QState(lightState); - QObject::connect(timing, SIGNAL(entered()), light, SLOT(turnOn())); - QObject::connect(timing, SIGNAL(entered()), timer, SLOT(start())); - QObject::connect(timing, SIGNAL(exited()), light, SLOT(turnOff())); + QObject::connect(timing, &QAbstractState::entered, light, &LightWidget::turnOn); + QObject::connect(timing, &QAbstractState::entered, timer, QOverload<>::of(&QTimer::start)); + QObject::connect(timing, &QAbstractState::exited, light, &LightWidget::turnOff); QFinalState *done = new QFinalState(lightState); - timing->addTransition(timer, SIGNAL(timeout()), done); + timing->addTransition(timer, &QTimer::timeout, done); lightState->setInitialState(timing); return lightState; } @@ -159,14 +159,14 @@ public: redGoingYellow->setObjectName("redGoingYellow"); QState *yellowGoingGreen = createLightState(widget->yellowLight(), 1000); yellowGoingGreen->setObjectName("yellowGoingGreen"); - redGoingYellow->addTransition(redGoingYellow, SIGNAL(finished()), yellowGoingGreen); + redGoingYellow->addTransition(redGoingYellow, &QState::finished, yellowGoingGreen); QState *greenGoingYellow = createLightState(widget->greenLight(), 3000); greenGoingYellow->setObjectName("greenGoingYellow"); - yellowGoingGreen->addTransition(yellowGoingGreen, SIGNAL(finished()), greenGoingYellow); + yellowGoingGreen->addTransition(yellowGoingGreen, &QState::finished, greenGoingYellow); QState *yellowGoingRed = createLightState(widget->yellowLight(), 1000); yellowGoingRed->setObjectName("yellowGoingRed"); - greenGoingYellow->addTransition(greenGoingYellow, SIGNAL(finished()), yellowGoingRed); - yellowGoingRed->addTransition(yellowGoingRed, SIGNAL(finished()), redGoingYellow); + greenGoingYellow->addTransition(greenGoingYellow, &QState::finished, yellowGoingRed); + yellowGoingRed->addTransition(yellowGoingRed, &QState::finished, redGoingYellow); machine->addState(redGoingYellow); machine->addState(yellowGoingGreen); diff --git a/examples/widgets/statemachine/twowaybutton/main.cpp b/examples/widgets/statemachine/twowaybutton/main.cpp index 5c778aba70..3d4fef3bbe 100644 --- a/examples/widgets/statemachine/twowaybutton/main.cpp +++ b/examples/widgets/statemachine/twowaybutton/main.cpp @@ -69,8 +69,8 @@ int main(int argc, char **argv) //! [1] //! [2] - off->addTransition(&button, SIGNAL(clicked()), on); - on->addTransition(&button, SIGNAL(clicked()), off); + off->addTransition(&button, &QAbstractButton::clicked, on); + on->addTransition(&button, &QAbstractButton::clicked, off); //! [2] //! [3] |