It may behave incorrectly because you are emitting the signal to the thread object. And the thread object lives in the same thread as the calling object (only objects created within run() or from within methods called from the thread's event loop live in the worker thread), so the slot might be called by the wrong (main) thread. It could be possible that all you need to do is to wait until the thread is started before emitting the signal (but you have to explicitely use queued connections for that to work!) - that would explain why subsequent signals work correctly.
connections.
at( i
)->start
( QThread::NormalPriority );
while(!connections.
at(i
)->isRunning
()) QThread::sleep(100);
//crude, but should work
connections.at( i )->start( QThread::NormalPriority );
while(!connections.at(i)->isRunning()) QThread::sleep(100); //crude, but should work
To copy to clipboard, switch view to plain text mode
Bookmarks