QGIS API Documentation
3.6.0-Noosa (5873452)
|
Provides threading utilities for QGIS. More...
#include <qgsthreadingutils.h>
Static Public Member Functions | |
template<typename Func > | |
static bool | runOnMainThread (const Func &func, QgsFeedback *feedback=nullptr) |
Guarantees that func is executed on the main thread. More... | |
Provides threading utilities for QGIS.
Definition at line 35 of file qgsthreadingutils.h.
|
inlinestatic |
Guarantees that func is executed on the main thread.
If this is called from another thread, the other thread will be blocked until the function has been executed. This is useful to quickly access information from objects that live on the main thread and copying this information into worker threads. Avoid running expensive code inside func. If a feedback is provided, it will observe if the feedback is canceled. In case the feedback is canceled before the main thread started to run the function, it will return without executing the function.
Definition at line 56 of file qgsthreadingutils.h.