Concurrent map equivalent
-
operator()
will be executed in another thread, it will not block the GUI thread, it will not return until completed (of course) -
@Defohin said in Concurrent map equivalent:
But why is it not appearing the window If it's running in another thread?
WOW! we are taking this on a whole new level here! you need a QFutureWatcher on the QFuture and a slot connected to the
resultReadyAt
signal to display the results in the GUI -
- If you want to stop the calculation when the widget is closed reimplement the closeEvent and call cancel on the QFuture
- If you want to stop the calculation when the widget is destroyed reimplement the destructor and call cancel on the QFuture