QStateMachine: add objectName to objects to ease debugging.
Change-Id: I3c495cc5bd04c0cac24d4abf827d6acfb35b8433 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
This commit is contained in:
parent
cd4fbead3b
commit
8e12367a94
@ -4275,26 +4275,34 @@ void tst_QStateMachine::parallelStateTransition()
|
||||
QStateMachine machine;
|
||||
|
||||
QState *parallelState = new QState(QState::ParallelStates, &machine);
|
||||
parallelState->setObjectName("parallelState");
|
||||
DEFINE_ACTIVE_SPY(parallelState);
|
||||
machine.setInitialState(parallelState);
|
||||
|
||||
QState *s1 = new QState(parallelState);
|
||||
s1->setObjectName("s1");
|
||||
DEFINE_ACTIVE_SPY(s1);
|
||||
QState *s2 = new QState(parallelState);
|
||||
s2->setObjectName("s2");
|
||||
DEFINE_ACTIVE_SPY(s2);
|
||||
|
||||
QState *s1InitialChild = new QState(s1);
|
||||
s1InitialChild->setObjectName("s1InitialChild");
|
||||
DEFINE_ACTIVE_SPY(s1InitialChild);
|
||||
s1->setInitialState(s1InitialChild);
|
||||
|
||||
QState *s2InitialChild = new QState(s2);
|
||||
s2InitialChild->setObjectName("s2InitialChild");
|
||||
DEFINE_ACTIVE_SPY(s2InitialChild);
|
||||
s2->setInitialState(s2InitialChild);
|
||||
|
||||
QState *s1OtherChild = new QState(s1);
|
||||
s1OtherChild->setObjectName("s1OtherChild");
|
||||
DEFINE_ACTIVE_SPY(s1OtherChild);
|
||||
|
||||
s1->addTransition(new EventTransition(QEvent::User, s1OtherChild));
|
||||
EventTransition *et = new EventTransition(QEvent::User, s1OtherChild);
|
||||
et->setObjectName("s1->s1OtherChild");
|
||||
s1->addTransition(et);
|
||||
|
||||
machine.start();
|
||||
QCoreApplication::processEvents();
|
||||
|
Loading…
Reference in New Issue
Block a user