diff options
author | Kent Hansen <khansen@trolltech.com> | 2009-05-07 10:40:38 (GMT) |
---|---|---|
committer | Kent Hansen <khansen@trolltech.com> | 2009-05-07 10:41:11 (GMT) |
commit | 81eebfbe01edb002d55c3504cc2558689cf0f936 (patch) | |
tree | 1cee50ade6cfd167cf503182b7f67afe5081fe56 /src/corelib/statemachine | |
parent | 1e404bcb6df5127a1d0e24ed11cce1c0260a57e9 (diff) | |
download | Qt-81eebfbe01edb002d55c3504cc2558689cf0f936.zip Qt-81eebfbe01edb002d55c3504cc2558689cf0f936.tar.gz Qt-81eebfbe01edb002d55c3504cc2558689cf0f936.tar.bz2 |
add QStateMachine::isRunning()
Diffstat (limited to 'src/corelib/statemachine')
-rw-r--r-- | src/corelib/statemachine/qstatemachine.cpp | 11 | ||||
-rw-r--r-- | src/corelib/statemachine/qstatemachine.h | 2 |
2 files changed, 13 insertions, 0 deletions
diff --git a/src/corelib/statemachine/qstatemachine.cpp b/src/corelib/statemachine/qstatemachine.cpp index 4533115..21e564c 100644 --- a/src/corelib/statemachine/qstatemachine.cpp +++ b/src/corelib/statemachine/qstatemachine.cpp @@ -1728,6 +1728,17 @@ void QStateMachine::removeState(QAbstractState *state) } /*! + Returns whether this state machine is running. + + start(), stop() +*/ +bool QStateMachine::isRunning() const +{ + Q_D(const QStateMachine); + return (d->state == QStateMachinePrivate::Running); +} + +/*! Starts this state machine. The machine will reset its configuration and transition to the initial state. When a final top-level state (QFinalState) is entered, the machine will emit the finished() signal. diff --git a/src/corelib/statemachine/qstatemachine.h b/src/corelib/statemachine/qstatemachine.h index d73404a..5dc6c0b 100644 --- a/src/corelib/statemachine/qstatemachine.h +++ b/src/corelib/statemachine/qstatemachine.h @@ -108,6 +108,8 @@ public: QString errorString() const; void clearError(); + bool isRunning() const; + #ifndef QT_NO_ANIMATION bool animationsEnabled() const; void setAnimationsEnabled(bool enabled); |