Syntalos::MainCallback
Syntalos::MainCallback
A callback that a worker can invoke from its thread, to run code on the main thread. More…
#include <moduleworker.h>
Public Functions
| Name | |
|---|---|
| MainCallback() =default | |
| MainCallback(QObject * context, std::function< void(const Args &…)> fn) | |
| void | operator()(Args… args) const |
| operator bool() const |
Detailed Description
template <typename... Args>
class Syntalos::MainCallback;A callback that a worker can invoke from its thread, to run code on the main thread.
Created by the module via AbstractModule::mainCallback() and handed to the worker. Calling it copies the arguments and queues the wrapped function into the event loop of the module’s thread, so the function may safely touch the module and its GUI. The call returns immediately; nothing is executed if the module no longer exists by the time the event loop gets to it.
Public Functions Documentation
function MainCallback
MainCallback() =defaultfunction MainCallback
inline MainCallback(
QObject * context,
std::function< void(const Args &...)> fn
)function operator()
inline void operator()(
Args... args
) constfunction operator bool
inline explicit operator bool() constUpdated on 2026-11-26 at 18:54:14 +0000