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

Qt Code:
  1. connectionMachine = new QStateMachine(this);
  2. disconnected_SM = new QState();
  3. connecting_SM = new QState();
  4. connected_SM = new QState();
  5. statusCheck_SM = new QState();
  6. commsReady_SM = new QState();
  7.  
  8. disconnected_SM->addTransition(this, SIGNAL(connectToHost_SM()), connecting_SM);
  9. connecting_SM->addTransition(&commandSequencer, SIGNAL(connected()), connected_SM);
  10. connected_SM->addTransition(this, SIGNAL(updatingStatus_SM()), statusCheck_SM);
  11.  
  12. connectionMachine->addState(disconnected_SM);
  13. connectionMachine->addState(connecting_SM);
  14. connectionMachine->addState(connected_SM);
  15. connectionMachine->addState(statusCheck_SM);
  16.  
  17. connect(connecting_SM, SIGNAL(entered()), this, SLOT(debugConnecting()));
  18. connect(connected_SM, SIGNAL(entered()), this, SLOT(updateStatus()));
  19.  
  20. connectionMachine->setInitialState(disconnected_SM);
  21. connectionMachine->start();
To copy to clipboard, switch view to plain text mode