diff options
author | Kent Hansen <khansen@trolltech.com> | 2009-08-03 08:35:37 (GMT) |
---|---|---|
committer | Kent Hansen <khansen@trolltech.com> | 2009-08-03 08:40:30 (GMT) |
commit | acd156649b1083aeeb400fe8fdbbf4e55ada4bed (patch) | |
tree | e74b2486cacc4b318b5c0533360ab03e1923a11d /src/corelib/statemachine/qstatemachine.cpp | |
parent | 45005c68c6effa41108ef55cd10a84f5977f79a0 (diff) | |
download | Qt-acd156649b1083aeeb400fe8fdbbf4e55ada4bed.zip Qt-acd156649b1083aeeb400fe8fdbbf4e55ada4bed.tar.gz Qt-acd156649b1083aeeb400fe8fdbbf4e55ada4bed.tar.bz2 |
remove constructors that are not useful
The constructors that take a list of target states produce
hard-to-read code, and they're rarely useful in practice since
99% of transitions take a single target state; so it's better
to enforce that setTarget{State,States}() be used instead.
Diffstat (limited to 'src/corelib/statemachine/qstatemachine.cpp')
-rw-r--r-- | src/corelib/statemachine/qstatemachine.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/corelib/statemachine/qstatemachine.cpp b/src/corelib/statemachine/qstatemachine.cpp index 5aa5917..9cb1d4d 100644 --- a/src/corelib/statemachine/qstatemachine.cpp +++ b/src/corelib/statemachine/qstatemachine.cpp @@ -1139,7 +1139,8 @@ class InitialTransition : public QAbstractTransition { public: InitialTransition(QAbstractState *target) - : QAbstractTransition(QList<QAbstractState*>() << target) {} + : QAbstractTransition() + { setTargetState(target); } protected: virtual bool eventTest(QEvent *) { return true; } virtual void onTransition(QEvent *) {} @@ -1306,7 +1307,8 @@ class GoToStateTransition : public QAbstractTransition { public: GoToStateTransition(QAbstractState *target) - : QAbstractTransition(QList<QAbstractState*>() << target) {} + : QAbstractTransition() + { setTargetState(target); } protected: void onTransition(QEvent *) { deleteLater(); } bool eventTest(QEvent *) { return true; } |