diff options
author | Kent Hansen <khansen@trolltech.com> | 2009-09-29 15:04:09 +0200 |
---|---|---|
committer | Kent Hansen <khansen@trolltech.com> | 2009-09-29 15:09:36 +0200 |
commit | f6a6e30eb16616b90d90fd6e20f9d840da41b9d1 (patch) | |
tree | 5e3a5ca259a06d78cb7cc2777084bc4118724322 /examples | |
parent | 1fd189619149c6d3489a35e42c4034d4145237dc (diff) |
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')
-rw-r--r-- | examples/statemachine/pingpong/main.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/examples/statemachine/pingpong/main.cpp b/examples/statemachine/pingpong/main.cpp index 7e3d8b15a1..358c499e47 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"); } }; |