Adding a Thread


I have a plugin that performs some measurements and displays the results on the GUI. I want to add a Thread to the Editor class so that I can send these results (that I print on the GUI) to a server, by calling a function “sendData()” inside.

How can I add a Thread to send the data?


1 Like

If you really just need to call sendData() on its own thread and forget about it, Thread::launch() can do that for you.

Somewhere in your editor you could just call (disclaimer: untested code)

Thread::launch ([this] { sendData(); });
1 Like