Closed rgoulter closed 6 years ago
Examples of appropriate solutions:
If we want to show progress:
QThread::run()
and start the QThread
. Emit signals to update progress.QRunnable::run()
and add the QRunnable
to a QThreadPool
. Write to a thread-safe variable to update progress.QtConcurrent::run()
. Write to a thread-safe variable to update progress.If we don't care about the progress:
QtConcurrent::run()
. Have a QFutureWatcher
emit the finished()
signal when the function has returned, and call QFutureWatcher::result()
to get the function's return value.TBH I feel showing 'progress' would be quite useful. e.g. our Delaunay algorithm is very slow. I kinda wanna see how slow.
Also, if we show 'progress'; it may be possible to "show" the current state of the algorithm? (Or, maybe that could be a separate issue after this).
Since we're using Qt5 anyway, might as well use its threading capabilities. https://doc.qt.io/qt-5.10/thread-basics.html