From f87641584424deed25e2abdadea08c3be94b9ce1 Mon Sep 17 00:00:00 2001 From: Kent Hansen Date: Wed, 22 Apr 2009 17:20:19 +0200 Subject: kill the stateactions api It just didn't give us that much. Typically you just reimplement onEntry/onExit/onTransition when you want to do something. We go back to the signals-and-slots approach: states have entered() and exited() signals that you can connect to. It's still possible to have an action-based API, but then you build it on top of the core API, which is OK. Replacing 4 public classes (and one layer in the hierarchy) with 2 signals feels good. --- src/corelib/statemachine/qabstractstate.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/corelib/statemachine/qabstractstate.h') diff --git a/src/corelib/statemachine/qabstractstate.h b/src/corelib/statemachine/qabstractstate.h index b788a88d65..55e9a621a5 100644 --- a/src/corelib/statemachine/qabstractstate.h +++ b/src/corelib/statemachine/qabstractstate.h @@ -75,6 +75,10 @@ public: void setRestorePolicy(RestorePolicy restorePolicy); RestorePolicy restorePolicy() const; +Q_SIGNALS: + void entered(); + void exited(); + protected: QAbstractState(QState *parent = 0); -- cgit v1.2.1