diff options
author | Erik Verbruggen <erik.verbruggen@theqtcompany.com> | 2015-08-27 09:09:44 +0200 |
---|---|---|
committer | Erik Verbruggen <erik.verbruggen@theqtcompany.com> | 2015-08-27 10:55:54 +0300 |
commit | ebe78bea46d0a6df5b18357dadd0c2834ab76eda (patch) | |
tree | a25874247d276c77816d71ffef47999cc5d9e8bf /tools | |
parent | 039b60bd7159d0080c5bfc22458054a7a54f0b35 (diff) |
Fix initial state attribute handling.
Multiple bugs:
- it was storing in the wrong data structure, therefore never "seen"
by any code outside the parser
- a <state> can have multiple states in the initial attribute, which
wasn't handled.
Change-Id: I0065108b230067a099fd86e12084f5ac2fd6bc5e
Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/qscxmlc/scxmlcppdumper.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/tools/qscxmlc/scxmlcppdumper.cpp b/tools/qscxmlc/scxmlcppdumper.cpp index 45ca900..dc7588c 100644 --- a/tools/qscxmlc/scxmlcppdumper.cpp +++ b/tools/qscxmlc/scxmlcppdumper.cpp @@ -292,8 +292,9 @@ protected: if (!node->id.isEmpty() && m_options.nameQObjects) { clazz.init.impl << stateName + QStringLiteral(".setObjectName(string(%1));").arg(addString(node->id)); } - if (node->initialState) { - clazz.init.impl << stateName + QStringLiteral(".setInitialState(&state_") + mangledName(node->initialState) + QStringLiteral(");"); + foreach (AbstractState *initialState, node->initialStates) { + clazz.init.impl << stateName + QStringLiteral(".setInitialState(&state_") + + mangledName(initialState) + QStringLiteral(");"); } if (node->type == State::Parallel) { clazz.init.impl << stateName + QStringLiteral(".setChildMode(QState::ParallelStates);"); |