summaryrefslogtreecommitdiffstats
path: root/examples/statemachine
diff options
context:
space:
mode:
authorKent Hansen <khansen@trolltech.com>2009-09-29 13:04:09 (GMT)
committerKent Hansen <khansen@trolltech.com>2009-09-29 13:09:36 (GMT)
commitf6a6e30eb16616b90d90fd6e20f9d840da41b9d1 (patch)
tree5e3a5ca259a06d78cb7cc2777084bc4118724322 /examples/statemachine
parent1fd189619149c6d3489a35e42c4034d4145237dc (diff)
downloadQt-f6a6e30eb16616b90d90fd6e20f9d840da41b9d1.zip
Qt-f6a6e30eb16616b90d90fd6e20f9d840da41b9d1.tar.gz
Qt-f6a6e30eb16616b90d90fd6e20f9d840da41b9d1.tar.bz2
Introduce state machine event priority, make it possible to cancel events
The priority specifies whether the event should be posted to what the SCXML spec refers to as the "external" (NormalPriority) queue, or the "internal" (HighPriority) queue. Delayed events are now posted through a separate function, postDelayedEvent(). That function returns an id that can be passed to cancelDelayedEvent() to cancel it. Reviewed-by: Eskil Abrahamsen Blomfeldt
Diffstat (limited to 'examples/statemachine')
-rw-r--r--examples/statemachine/pingpong/main.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/examples/statemachine/pingpong/main.cpp b/examples/statemachine/pingpong/main.cpp
index 7e3d8b1..358c499 100644
--- a/examples/statemachine/pingpong/main.cpp
+++ b/examples/statemachine/pingpong/main.cpp
@@ -86,7 +86,7 @@ protected:
}
virtual void onTransition(QEvent *)
{
- machine()->postEvent(new PingEvent(), 500);
+ machine()->postDelayedEvent(new PingEvent(), 500);
fprintf(stdout, "ping?\n");
}
};
@@ -104,7 +104,7 @@ protected:
}
virtual void onTransition(QEvent *)
{
- machine()->postEvent(new PongEvent(), 500);
+ machine()->postDelayedEvent(new PongEvent(), 500);
fprintf(stdout, "pong!\n");
}
};