Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Send Var to Main thread
Alexanov last edited by
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.