Send Var to Main thread
How can I send Variable or data from worker Thread (or other Thread implementation ) to Gui (Main Thread)?
I do vice versa (Gui Thread to other thread ) with signal/slot.
Thats exactly the way to do it:
signals: void sendData(QVariant value); ... slots: void getData(QVariant value); //connect the 2 connect(ObjectInThread1, &myThreadedClass1::sendData, ObjectInThread2, &mainThreadClass::getData, Qt::QueuedConnection);
with5th paramter is optional, but either leave it open aka
@Alexanov There is no difference whether from main thread to other thread or from other thread to main thread.