Both options are OK, it depends on what the thread does.
The first is the better option for something that is a single, long operation, the second is a good option for things that need events while processing.
I personally would chose option 1 for that, way easier IMHO.
At which of the two connects to you get the error?
It looks fine.
Your worker code does not output any thread ID, you only ever write the main thread's ID in the dialog code.
Concurrent access to members by multiple threads needs to be serialized, e.g. by using a mutex.
Here that is the access to "stopped", which is accessed by the worker thread in process() and by the main thread in stop() and start().
QThread::exit() doesn't make much sense here. When wait() returns the thread has already exited.
Cheers,
_
Bookmarks