Qt Code:
while(eThread.isRunning()) usleep(100);To copy to clipboard, switch view to plain text mode
But what is this for? It stops the main thread. And if so, why do you need another thread? You can move its functionality to the main thread and the result will be identical. Better yet, you can split the work you do in the other thread into smaller chunks and use a QTimer with 0 interval to trigger next steps of the process and you'll gain this, that you won't block the event handling and your gui will remain responsive.
"Common" doesn't mean "proper". You can achieve the same without using a separate thread which only slows down the process.I think, my case is very common case in UI coding. Isn't it?
Bookmarks