diff options
author | Kent Hansen <khansen@trolltech.com> | 2009-04-22 15:20:19 (GMT) |
---|---|---|
committer | Kent Hansen <khansen@trolltech.com> | 2009-04-22 15:20:19 (GMT) |
commit | f87641584424deed25e2abdadea08c3be94b9ce1 (patch) | |
tree | a185687744e724a8db896970416f23d20f5cad38 /src/corelib/statemachine/qstate.cpp | |
parent | 31f5348ea1691a7664b6abc04cf425dd02637b33 (diff) | |
download | Qt-f87641584424deed25e2abdadea08c3be94b9ce1.zip Qt-f87641584424deed25e2abdadea08c3be94b9ce1.tar.gz Qt-f87641584424deed25e2abdadea08c3be94b9ce1.tar.bz2 |
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.
Diffstat (limited to 'src/corelib/statemachine/qstate.cpp')
-rw-r--r-- | src/corelib/statemachine/qstate.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/corelib/statemachine/qstate.cpp b/src/corelib/statemachine/qstate.cpp index 28c84d5..56a855e 100644 --- a/src/corelib/statemachine/qstate.cpp +++ b/src/corelib/statemachine/qstate.cpp @@ -138,7 +138,7 @@ const QStatePrivate *QStatePrivate::get(const QState *q) Constructs a new state with the given \a parent state. */ QState::QState(QState *parent) - : QActionState(*new QStatePrivate, parent) + : QAbstractState(*new QStatePrivate, parent) { } @@ -146,7 +146,7 @@ QState::QState(QState *parent) Constructs a new state of the given \a type with the given \a parent state. */ QState::QState(Type type, QState *parent) - : QActionState(*new QStatePrivate, parent) + : QAbstractState(*new QStatePrivate, parent) { Q_D(QState); d->isParallelGroup = (type == ParallelGroup); @@ -156,7 +156,7 @@ QState::QState(Type type, QState *parent) \internal */ QState::QState(QStatePrivate &dd, QState *parent) - : QActionState(dd, parent) + : QAbstractState(dd, parent) { } @@ -385,7 +385,6 @@ QHistoryState *QState::addHistoryState(HistoryType type) */ void QState::onEntry() { - QActionState::onEntry(); } /*! @@ -393,7 +392,6 @@ void QState::onEntry() */ void QState::onExit() { - QActionState::onExit(); } /*! @@ -430,7 +428,7 @@ void QState::setInitialState(QAbstractState *state) */ bool QState::event(QEvent *e) { - return QActionState::event(e); + return QAbstractState::event(e); } QT_END_NAMESPACE |