summaryrefslogtreecommitdiffstats
path: root/src/corelib/statemachine/qstatemachine.cpp
diff options
context:
space:
mode:
authorEskil Abrahamsen Blomfeldt <eblomfel@trolltech.com>2009-04-29 14:00:35 (GMT)
committerEskil Abrahamsen Blomfeldt <eblomfel@trolltech.com>2009-04-29 14:13:14 (GMT)
commit146a63c8025d4b5a20554e067d0246df9be3e68a (patch)
tree06c0ef9ab94e276648d34a243ff1b808a82674a2 /src/corelib/statemachine/qstatemachine.cpp
parenteea1c9f34b9b98c55c48f9ed1dbef9a9883c6f2a (diff)
downloadQt-146a63c8025d4b5a20554e067d0246df9be3e68a.zip
Qt-146a63c8025d4b5a20554e067d0246df9be3e68a.tar.gz
Qt-146a63c8025d4b5a20554e067d0246df9be3e68a.tar.bz2
SCXML defines an atomic state as a <state> with no children or <final>. However,
in SCXML it makes no sense for a <parallel> tag to be atomic, hence have no children, whereas in a dynamic state machine you might set an atomic state as parallel because this should govern the behavior if the state gets children later. We decided that the most intuitive definition is that a state is atomic if it has no children, regardless of whether it has the parallel child mode. With the old definition, transitions from empty parallel states will never be taken, as illustrated by the test.
Diffstat (limited to 'src/corelib/statemachine/qstatemachine.cpp')
-rw-r--r--src/corelib/statemachine/qstatemachine.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/corelib/statemachine/qstatemachine.cpp b/src/corelib/statemachine/qstatemachine.cpp
index 8dfb229..2f8a19e 100644
--- a/src/corelib/statemachine/qstatemachine.cpp
+++ b/src/corelib/statemachine/qstatemachine.cpp
@@ -772,9 +772,8 @@ bool QStateMachinePrivate::isCompound(const QAbstractState *s)
bool QStateMachinePrivate::isAtomic(const QAbstractState *s)
{
const QState *ss = qobject_cast<const QState*>(s);
- return (ss && (QStatePrivate::get(ss)->childMode != QState::ParallelStates)
- && QStatePrivate::get(ss)->childStates().isEmpty())
- || isFinal(s);
+ return (ss && QStatePrivate::get(ss)->childStates().isEmpty())
+ || isFinal(s);
}