<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Send Var to Main thread]]></title><description><![CDATA[<p dir="auto">Hi<br />
How can I send Variable or data from worker Thread (or other Thread implementation ) to Gui (Main Thread)?<br />
I do vice versa (Gui Thread to other thread ) with signal/slot.</p>
]]></description><link>https://forum.qt.io/topic/80231/send-var-to-main-thread</link><generator>RSS for Node</generator><lastBuildDate>Sun, 20 Sep 2026 17:58:34 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/80231.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 12 Jun 2017 11:39:16 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Send Var to Main thread on Mon, 12 Jun 2017 11:52:32 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/alexanov">@<bdi>Alexanov</bdi></a> There is no difference whether from main thread to other thread or from other thread to main thread.</p>
]]></description><link>https://forum.qt.io/post/398981</link><guid isPermaLink="true">https://forum.qt.io/post/398981</guid><dc:creator><![CDATA[jsulm]]></dc:creator><pubDate>Mon, 12 Jun 2017 11:52:32 GMT</pubDate></item><item><title><![CDATA[Reply to Send Var to Main thread on Mon, 12 Jun 2017 11:56:24 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/alexanov">@<bdi>Alexanov</bdi></a><br />
Thats exactly the way to do it:</p>
<pre><code>signals:
   void sendData(QVariant value);

...
slots:
   void getData(QVariant value);


//connect the 2

connect(ObjectInThread1, &amp;myThreadedClass1::sendData, ObjectInThread2, &amp;mainThreadClass::getData, Qt::QueuedConnection);

</code></pre>
<p dir="auto">the <s>with</s>5th paramter is optional, but either leave it open aka <code>Qt::AutoConnection </code> or write <code>Qt::QueuedConnection</code></p>
]]></description><link>https://forum.qt.io/post/398978</link><guid isPermaLink="true">https://forum.qt.io/post/398978</guid><dc:creator><![CDATA[J.Hilk]]></dc:creator><pubDate>Mon, 12 Jun 2017 11:56:24 GMT</pubDate></item></channel></rss>