jimiq
17th November 2009, 18:13
Hi,
I have set up a QStateMachine but I am not getting an entered() signal from any of the states and Creator editor is not even showing this in the class list as I type it in the connect function. I only get destroyed, polished and finished in the list. function code below.
What am I doing wrong? ....any suggestions.
Many thanks
Jim
connectionMachine = new QStateMachine(this);
disconnected_SM = new QState();
connecting_SM = new QState();
connected_SM = new QState();
statusCheck_SM = new QState();
commsReady_SM = new QState();
disconnected_SM->addTransition(this, SIGNAL(connectToHost_SM()), connecting_SM);
connecting_SM->addTransition(&commandSequencer, SIGNAL(connected()), connected_SM);
connected_SM->addTransition(this, SIGNAL(updatingStatus_SM()), statusCheck_SM);
connectionMachine->addState(disconnected_SM);
connectionMachine->addState(connecting_SM);
connectionMachine->addState(connected_SM);
connectionMachine->addState(statusCheck_SM);
connect(connecting_SM, SIGNAL(entered()), this, SLOT(debugConnecting()));
connect(connected_SM, SIGNAL(entered()), this, SLOT(updateStatus()));
connectionMachine->setInitialState(disconnected_SM);
connectionMachine->start();
I have set up a QStateMachine but I am not getting an entered() signal from any of the states and Creator editor is not even showing this in the class list as I type it in the connect function. I only get destroyed, polished and finished in the list. function code below.
What am I doing wrong? ....any suggestions.
Many thanks
Jim
connectionMachine = new QStateMachine(this);
disconnected_SM = new QState();
connecting_SM = new QState();
connected_SM = new QState();
statusCheck_SM = new QState();
commsReady_SM = new QState();
disconnected_SM->addTransition(this, SIGNAL(connectToHost_SM()), connecting_SM);
connecting_SM->addTransition(&commandSequencer, SIGNAL(connected()), connected_SM);
connected_SM->addTransition(this, SIGNAL(updatingStatus_SM()), statusCheck_SM);
connectionMachine->addState(disconnected_SM);
connectionMachine->addState(connecting_SM);
connectionMachine->addState(connected_SM);
connectionMachine->addState(statusCheck_SM);
connect(connecting_SM, SIGNAL(entered()), this, SLOT(debugConnecting()));
connect(connected_SM, SIGNAL(entered()), this, SLOT(updateStatus()));
connectionMachine->setInitialState(disconnected_SM);
connectionMachine->start();