When m_serverClientControl emits finishedRunning() on its thread, How can I tell what slot gets executed first/last in the main thread? How do the slots get queued in a situation like this? I’m confused as how Qt places slot events on the thread event queue. I have read the document ion but I’m still a tad bit confused.
connect( m_serverClientControl, SIGNAL( finishedRunning() ), m_serverClientControl, SLOT( deleteLater() ) );
connect( m_serverClientControl, SIGNAL( finishedRunning() ), this, SLOT( finishedRunningEmited() ) )
From the Qt 4.7 docs:
http://doc.qt.io/archives/qt-4.7/signalsandslots.html#signals
So in your case
finishedRunningEmited()should be called afterdeleteLater().