connect() means it is connected, not that it is emitted.
No, no....what I mean is that I put in
Qt Code:
connect(this, SIGNAL(connectToHost_SM()), this, SLOT(debugConnectToHost_SM()));To copy to clipboard, switch view to plain text mode
in order to see if connectToHost_SM() is emitted and debugConnectToHost_SM() just outputs a qDebug message so I can see that at runtime connectToHost_SM() is emitted.
jim
Please provide a minimal compilable example reproducing the problem. The code you pasted looks correct so the problem is probably elsewhere. Try isolating it from the rest of your code.
I haven't got round to getting a compiled version to post but I have noticed that the state machine does start. I have put a qDebug line after the .start() to check if the state machine is running but it comes back as not running!!!! any suggestions?
It's an asynchronous call. The machine will start next time Qt enters the event loop.
jimiq (19th November 2009)
I have no other events running at that time.
I checked if it was running later in the app and it still comes back with stopped
As already said, provide a minimal compilable example reproducing the problem. I can't help you without knowing what you did.
I managed to find the problem. When you mentioned about it being an asynchronous call got me thinking. I found that I was calling the state machine in the constructor of my dialog and was trying to trigger it too early. I then added a slot/signal combination to wait for the started() signal from the state machine before trying to create the TCP socket and now all appears fine.
Thanks for your help.
Jim
Bookmarks