summaryrefslogtreecommitdiffstats
path: root/src/corelib/statemachine/qstatemachine.h
diff options
context:
space:
mode:
authorKent Hansen <khansen@trolltech.com>2009-09-29 15:04:09 +0200
committerKent Hansen <khansen@trolltech.com>2009-09-29 15:09:36 +0200
commitf6a6e30eb16616b90d90fd6e20f9d840da41b9d1 (patch)
tree5e3a5ca259a06d78cb7cc2777084bc4118724322 /src/corelib/statemachine/qstatemachine.h
parent1fd189619149c6d3489a35e42c4034d4145237dc (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 'src/corelib/statemachine/qstatemachine.h')
-rw-r--r--src/corelib/statemachine/qstatemachine.h11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/corelib/statemachine/qstatemachine.h b/src/corelib/statemachine/qstatemachine.h
index a0b2b146b7..321a05c698 100644
--- a/src/corelib/statemachine/qstatemachine.h
+++ b/src/corelib/statemachine/qstatemachine.h
@@ -102,6 +102,11 @@ public:
QEvent *m_event;
};
+ enum EventPriority {
+ NormalPriority,
+ HighPriority
+ };
+
enum RestorePolicy {
DoNotRestoreProperties,
RestoreProperties
@@ -138,7 +143,9 @@ public:
QStateMachine::RestorePolicy globalRestorePolicy() const;
void setGlobalRestorePolicy(QStateMachine::RestorePolicy restorePolicy);
- void postEvent(QEvent *event, int delay = 0);
+ void postEvent(QEvent *event, EventPriority priority = NormalPriority);
+ int postDelayedEvent(QEvent *event, int delay);
+ bool cancelDelayedEvent(int id);
QSet<QAbstractState*> configuration() const;
@@ -158,8 +165,6 @@ protected:
void onEntry(QEvent *event);
void onExit(QEvent *event);
- void postInternalEvent(QEvent *event);
-
virtual void beginSelectTransitions(QEvent *event);
virtual void endSelectTransitions(QEvent *event);