diff options
author | Eskil Abrahamsen Blomfeldt <eblomfel@trolltech.com> | 2009-06-23 09:20:34 (GMT) |
---|---|---|
committer | Eskil Abrahamsen Blomfeldt <eblomfel@trolltech.com> | 2009-06-23 09:23:45 (GMT) |
commit | 6769af5510b963e10dc045630e1ab07fd16ba6d1 (patch) | |
tree | a421e6f74a6e2f327225ad7177c680cca874d5a2 /src/corelib/statemachine/qstate.cpp | |
parent | ce8eaf11405f8acd607f29af5b7daeb57b4abb6d (diff) | |
download | Qt-6769af5510b963e10dc045630e1ab07fd16ba6d1.zip Qt-6769af5510b963e10dc045630e1ab07fd16ba6d1.tar.gz Qt-6769af5510b963e10dc045630e1ab07fd16ba6d1.tar.bz2 |
Remove default error state
Having an implicit default error state in the graph which the user
has not added is unintuitive and ugly. Rather than have a default error
state, we stop execution of the machine and print an error message when
the machine has run-time errors. If a user wishes to prevent errors
from stopping the machine, you can set one or more error states
explicitly.
Diffstat (limited to 'src/corelib/statemachine/qstate.cpp')
-rw-r--r-- | src/corelib/statemachine/qstate.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/corelib/statemachine/qstate.cpp b/src/corelib/statemachine/qstate.cpp index fd7ddef..83dd869 100644 --- a/src/corelib/statemachine/qstate.cpp +++ b/src/corelib/statemachine/qstate.cpp @@ -240,7 +240,7 @@ void QState::assignProperty(QObject *object, const char *name, } /*! - Returns this state group's error state. + Returns this state's error state. \sa QStateMachine::errorState(), QStateMachine::setErrorState() */ @@ -253,7 +253,9 @@ QAbstractState *QState::errorState() const /*! Sets this state's error state to be the given \a state. If the error state is not set, or if it is set to 0, the state will inherit its parent's error - state recursively. + state recursively. If no error state is set for the state itself or any of + its ancestors, an error will cause the machine to stop executing and an error + will be printed to the console. \sa QStateMachine::setErrorState(), QStateMachine::errorState() */ |