summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJan Arne Petersen <jan.petersen@kdab.com>2016-12-06 20:59:36 +0100
committerJani Heikkinen <jani.heikkinen@qt.io>2016-12-08 05:11:51 +0000
commitcfade3a4a723c09bb6653c115afc961f8bc42b35 (patch)
tree8db1a203d1762775ca198bc1046b2da5dac55e4e /src
parent249b698b3963a0207aafc2cf65ce2dd9e5835676 (diff)
Emit runningChanged signal when running changes
The QScxmlStateMachine::runningChanged signal was never emitted. Emit it when the running property changes. Change-Id: I9b6cb8d48c9c8d893b0af2b8f87ecd74f4e64055 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Kevin Funk <kevin.funk@kdab.com>
Diffstat (limited to 'src')
-rw-r--r--src/scxml/qscxmlstatemachine.cpp15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/scxml/qscxmlstatemachine.cpp b/src/scxml/qscxmlstatemachine.cpp
index 61a37ef..6bc7ab5 100644
--- a/src/scxml/qscxmlstatemachine.cpp
+++ b/src/scxml/qscxmlstatemachine.cpp
@@ -609,17 +609,27 @@ void QScxmlStateMachinePrivate::submitError(const QString &type, const QString &
void QScxmlStateMachinePrivate::start()
{
+ Q_Q(QScxmlStateMachine);
+
if (m_stateTable->binding == StateTable::LateBinding)
m_isFirstStateEntry.resize(m_stateTable->stateCount, true);
+ bool running = isRunnable() && !isPaused();
m_runningState = Starting;
Q_ASSERT(m_stateTable->initialTransition != StateTable::InvalidIndex);
+
+ if (!running)
+ emit q->runningChanged(true);
}
void QScxmlStateMachinePrivate::pause()
{
- if (isRunnable() && !isPaused())
+ Q_Q(QScxmlStateMachine);
+
+ if (isRunnable() && !isPaused()) {
m_runningState = Paused;
+ emit q->runningChanged(false);
+ }
}
void QScxmlStateMachinePrivate::processEvents()
@@ -1106,7 +1116,10 @@ void QScxmlStateMachinePrivate::enterStates(const OrderedSet &enabledTransitions
m_executionEngine->execute(dhc);
if (state.type == StateTable::State::Final) {
if (state.parentIsScxmlElement()) {
+ bool running = isRunnable() && !isPaused();
m_runningState = Finished;
+ if (running)
+ emit q->runningChanged(false);
} else {
const auto &parent = m_stateTable->state(state.parent);
m_executionEngine->execute(state.doneData, m_tableData->string(parent.name));