<?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[how to defined a slot   when is call is executed on separately Qthread c++?]]></title><description><![CDATA[<p dir="auto">i want to defined a slot when is called it executed on  separately Qthread c++.....<br />
when two slot are on same thread we observed that signal second is queued and when<br />
first slot is fished another function slot is executed....</p>
]]></description><link>https://forum.qt.io/topic/118187/how-to-defined-a-slot-when-is-call-is-executed-on-separately-qthread-c</link><generator>RSS for Node</generator><lastBuildDate>Tue, 21 Apr 2026 19:27:10 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/118187.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 19 Aug 2020 09:10:40 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to how to defined a slot   when is call is executed on separately Qthread c++? on Thu, 20 Aug 2020 16:14:18 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/stackprogramer">@<bdi>stackprogramer</bdi></a><br />
I wouldn't use <code>waitForBytesWritten()</code> either, it's just another blocking call (so it requires a thread), I'd just use the signals.  And I don't see it tells you that much about what's really going on anyway.</p>
<p dir="auto">But you know more about your situation than I do.  Maybe you do need your threads for some reason.</p>
]]></description><link>https://forum.qt.io/post/613401</link><guid isPermaLink="true">https://forum.qt.io/post/613401</guid><dc:creator><![CDATA[JonB]]></dc:creator><pubDate>Thu, 20 Aug 2020 16:14:18 GMT</pubDate></item><item><title><![CDATA[Reply to how to defined a slot   when is call is executed on separately Qthread c++? on Thu, 20 Aug 2020 15:16:49 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/jonb">@<bdi>JonB</bdi></a><br />
we have problems when we write <strong>large data on serial port</strong>  and time writing on port is long time(For large file we have to slab data file and....sending it) and other serial port signals is triggered ..........we observe sending data is not real time and we have delay....because an other slot port is executed but first port serial  yet is writing........and finally .....<br />
<strong>we have lag in sending files....</strong></p>
<pre><code>  serialPort-&gt;write(serialDataResponse);
                        serialPort-&gt;waitForBytesWritten(300);
</code></pre>
]]></description><link>https://forum.qt.io/post/613396</link><guid isPermaLink="true">https://forum.qt.io/post/613396</guid><dc:creator><![CDATA[stackprogramer]]></dc:creator><pubDate>Thu, 20 Aug 2020 15:16:49 GMT</pubDate></item><item><title><![CDATA[Reply to how to defined a slot   when is call is executed on separately Qthread c++? on Thu, 20 Aug 2020 07:33:22 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/stackprogramer">@<bdi>stackprogramer</bdi></a><br />
I don't see why it matters whether you are managing 1 serial port or 100 serial ports.  I would expect Qt's asynchronous signals/slots to handle this without any need for threads.  That's all I can say.</p>
]]></description><link>https://forum.qt.io/post/613296</link><guid isPermaLink="true">https://forum.qt.io/post/613296</guid><dc:creator><![CDATA[JonB]]></dc:creator><pubDate>Thu, 20 Aug 2020 07:33:22 GMT</pubDate></item><item><title><![CDATA[Reply to how to defined a slot   when is call is executed on separately Qthread c++? on Thu, 20 Aug 2020 07:30:22 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/jonb">@<bdi>JonB</bdi></a> said in <a href="/post/613290">how to defined a slot when is call is executed on separately Qthread c++?</a>:</p>
<blockquote>
<p dir="auto">Just to say: of course I do not know what exactly your code does.  But people keep introducing threads --- which are complex in Qt --- to do things where Qt's existing asynchronous signal/slot architecture should mean there is no need to do so.  When using serial ports I see lots of people start using separate threads to handle blocking serial port calls, when they would be much better using no thread but non-blocking signals like readRead() instead.  So I hope you really know what you are doing/have a use case....</p>
</blockquote>
<p dir="auto">Hi <a class="plugin-mentions-user plugin-mentions-a" href="/user/jonb">@<bdi>JonB</bdi></a>  thanks for attention yes i know your solution but we have should used threads  because  we should manager 7 serial port and udp....a little delay we have lost</p>
<p dir="auto">we should managed timing  input and output data</p>
]]></description><link>https://forum.qt.io/post/613294</link><guid isPermaLink="true">https://forum.qt.io/post/613294</guid><dc:creator><![CDATA[stackprogramer]]></dc:creator><pubDate>Thu, 20 Aug 2020 07:30:22 GMT</pubDate></item><item><title><![CDATA[Reply to how to defined a slot   when is call is executed on separately Qthread c++? on Thu, 20 Aug 2020 07:14:32 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/stackprogramer">@<bdi>stackprogramer</bdi></a><br />
Just to say: of course I do not know what exactly your code does.  But people keep introducing threads --- which are complex in Qt --- to do things where Qt's existing <em>asynchronous</em> signal/slot architecture should mean there is no need to do so.  When using serial ports I see lots of people start using separate threads to handle blocking serial port calls, when they would be much better using no thread but non-blocking signals like <code>readRead()</code> instead.  So I hope you really know what you are doing/have a use case....</p>
]]></description><link>https://forum.qt.io/post/613290</link><guid isPermaLink="true">https://forum.qt.io/post/613290</guid><dc:creator><![CDATA[JonB]]></dc:creator><pubDate>Thu, 20 Aug 2020 07:14:32 GMT</pubDate></item><item><title><![CDATA[Reply to how to defined a slot   when is call is executed on separately Qthread c++? on Thu, 20 Aug 2020 07:00:19 GMT]]></title><description><![CDATA[<p dir="auto">Finally i used this way. i didn't used subclass as thread i used only a thread and i moved port serial to on it....</p>
<pre><code>    QThread* thread = new QThread;
    serialPort-&gt;moveToThread(thread);
    thread-&gt;start();
</code></pre>
]]></description><link>https://forum.qt.io/post/613288</link><guid isPermaLink="true">https://forum.qt.io/post/613288</guid><dc:creator><![CDATA[stackprogramer]]></dc:creator><pubDate>Thu, 20 Aug 2020 07:00:19 GMT</pubDate></item><item><title><![CDATA[Reply to how to defined a slot   when is call is executed on separately Qthread c++? on Wed, 19 Aug 2020 09:20:31 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/stackprogramer">@<bdi>stackprogramer</bdi></a><br />
Put the two slots separately in each of the two separate threads you want each one to execute in.  I don't know how to answer better than that.</p>
<p dir="auto">Don't forget that if you are using multiple threads you cannot/must not do an UI operations in anything other than main UI thread....</p>
]]></description><link>https://forum.qt.io/post/613121</link><guid isPermaLink="true">https://forum.qt.io/post/613121</guid><dc:creator><![CDATA[JonB]]></dc:creator><pubDate>Wed, 19 Aug 2020 09:20:31 GMT</pubDate></item></channel></rss>