QGIS API Documentation 3.41.0-Master (fda2aa46e9a)
|
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. | |
Provides threading utilities for QGIS.
Definition at line 119 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 140 of file qgsthreadingutils.h.