Hi,
i want my application to wait indefinitely till a task gets completed in another thread. How to perform this in Qt.
in windows we use waitforsingletonobject but is there any alternative to this. can i get some hints from you guys..
Thanks
Hi,
i want my application to wait indefinitely till a task gets completed in another thread. How to perform this in Qt.
in windows we use waitforsingletonobject but is there any alternative to this. can i get some hints from you guys..
Thanks
Waiting for threads to finish certain tasks (thread synchronization) is the job of the QWaitCondition class.
Use QtConcurrent::run. See my answer to this question. Note that the QFutureWatcher API can work in blocking (the waitForFinished
method) and non-blocking (the finished
signal) modes.