summaryrefslogtreecommitdiffstats
path: root/examples/statemachine/trafficlight/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'examples/statemachine/trafficlight/main.cpp')
-rw-r--r--examples/statemachine/trafficlight/main.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/examples/statemachine/trafficlight/main.cpp b/examples/statemachine/trafficlight/main.cpp
index 528ed00..115ecad 100644
--- a/examples/statemachine/trafficlight/main.cpp
+++ b/examples/statemachine/trafficlight/main.cpp
@@ -97,9 +97,9 @@ public:
timer->setInterval(duration);
timer->setSingleShot(true);
QState *timing = new QState(this);
- timing->invokeMethodOnEntry(light, "turnOn");
- timing->invokeMethodOnEntry(timer, "start");
- timing->invokeMethodOnExit(light, "turnOff");
+ QObject::connect(timing, SIGNAL(entered()), light, SLOT(turnOn()));
+ QObject::connect(timing, SIGNAL(entered()), timer, SLOT(start()));
+ QObject::connect(timing, SIGNAL(exited()), light, SLOT(turnOff()));
QFinalState *done = new QFinalState(this);
timing->addTransition(timer, SIGNAL(timeout()), done);
setInitialState(timing);