<?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 run background process when a Dialog is showed]]></title><description><![CDATA[<p dir="auto">I tried to run a process when a dialog is showed, But it didnt work . I want to show an dialog and at the same time i want to run the background process also , in which way this can be done ?</p>
]]></description><link>https://forum.qt.io/topic/107217/how-to-run-background-process-when-a-dialog-is-showed</link><generator>RSS for Node</generator><lastBuildDate>Sat, 18 Apr 2026 09:31:01 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/107217.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 26 Sep 2019 09:11:12 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to How to run background process when a Dialog is showed on Wed, 02 Oct 2019 07:03:48 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/maniron">@<bdi>ManiRon</bdi></a><br />
Just to be clear: it is precisely because <code>modal.exec()</code> does not return to the caller till after the dialog has been closed, while <code>modal.show()</code> lets the caller continue, (and you will later react via signal/slot to user closing dialog, documentation describes this behaviour) that I am saying you <em>may</em> be able to use <code>show()</code> so that your calling code can continue and do other processing without the need to create a separate thread.  It depends on what other processing you need to do, it was just a heads-up.</p>
]]></description><link>https://forum.qt.io/post/553905</link><guid isPermaLink="true">https://forum.qt.io/post/553905</guid><dc:creator><![CDATA[JonB]]></dc:creator><pubDate>Wed, 02 Oct 2019 07:03:48 GMT</pubDate></item><item><title><![CDATA[Reply to How to run background process when a Dialog is showed on Tue, 01 Oct 2019 11:45:42 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/mrjj">@<bdi>mrjj</bdi></a> said in <a href="/post/553771">How to run background process when a Dialog is showed</a>:</p>
<blockquote>
<p dir="auto">show() and exec()</p>
</blockquote>
<p dir="auto">Yes thanks</p>
]]></description><link>https://forum.qt.io/post/553779</link><guid isPermaLink="true">https://forum.qt.io/post/553779</guid><dc:creator><![CDATA[ManiRon]]></dc:creator><pubDate>Tue, 01 Oct 2019 11:45:42 GMT</pubDate></item><item><title><![CDATA[Reply to How to run background process when a Dialog is showed on Tue, 01 Oct 2019 10:59:38 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/maniron">@<bdi>ManiRon</bdi></a><br />
Ok that is good. Its an important difference between<br />
show() and exec()</p>
]]></description><link>https://forum.qt.io/post/553771</link><guid isPermaLink="true">https://forum.qt.io/post/553771</guid><dc:creator><![CDATA[mrjj]]></dc:creator><pubDate>Tue, 01 Oct 2019 10:59:38 GMT</pubDate></item><item><title><![CDATA[Reply to How to run background process when a Dialog is showed on Tue, 01 Oct 2019 09:28:22 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/mrjj">@<bdi>mrjj</bdi></a> I checked and it worked the way you specified</p>
]]></description><link>https://forum.qt.io/post/553761</link><guid isPermaLink="true">https://forum.qt.io/post/553761</guid><dc:creator><![CDATA[ManiRon]]></dc:creator><pubDate>Tue, 01 Oct 2019 09:28:22 GMT</pubDate></item><item><title><![CDATA[Reply to How to run background process when a Dialog is showed on Tue, 01 Oct 2019 09:19:19 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/maniron">@<bdi>ManiRon</bdi></a><br />
Hi<br />
It's important to understand that<br />
modal.exec() is a socalled blocking call.<br />
It spins an event loop in there and<br />
will first return once dialog is closed.</p>
<p dir="auto">That means it will NOT execute the next line after it dialog is gone.</p>
<p dir="auto">--<br />
modal.show() on the other hand is NOT blocking and<br />
will execute the next line as soon as show() has run and while the dialog is still being displayed.</p>
]]></description><link>https://forum.qt.io/post/553757</link><guid isPermaLink="true">https://forum.qt.io/post/553757</guid><dc:creator><![CDATA[mrjj]]></dc:creator><pubDate>Tue, 01 Oct 2019 09:19:19 GMT</pubDate></item><item><title><![CDATA[Reply to How to run background process when a Dialog is showed on Tue, 01 Oct 2019 09:12:51 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/553380">How to run background process when a Dialog is showed</a>:</p>
<blockquote>
<p dir="auto">while</p>
</blockquote>
<p dir="auto">Actually i tried something like this</p>
<pre><code>        qDebug("Before SHow");
        Modal.show();
        qDebug("After SHow");
</code></pre>
<p dir="auto">Similarly for Exec</p>
<pre><code>        qDebug("Before SHow");
        Modal.exec();
        qDebug("After SHow");
</code></pre>
<p dir="auto">But what i observed  was the first print was coming and later print was coming only when the Modal was closed</p>
]]></description><link>https://forum.qt.io/post/553754</link><guid isPermaLink="true">https://forum.qt.io/post/553754</guid><dc:creator><![CDATA[ManiRon]]></dc:creator><pubDate>Tue, 01 Oct 2019 09:12:51 GMT</pubDate></item><item><title><![CDATA[Reply to How to run background process when a Dialog is showed on Sat, 28 Sep 2019 14:22:22 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/maniron">@<bdi>ManiRon</bdi></a> said in <a href="/post/553341">How to run background process when a Dialog is showed</a>:</p>
<blockquote>
<p dir="auto">Process means in this case i meant the tasks that are done by me</p>
</blockquote>
<p dir="auto">Don't forget that if you don't want/need to have a separate thread, you can <em>show</em> a modal dialog   but not <em>block</em> by using <code>modal.show()</code> rather than <code>modal.exec()</code>, so you can still do work while modal displayed.</p>
]]></description><link>https://forum.qt.io/post/553380</link><guid isPermaLink="true">https://forum.qt.io/post/553380</guid><dc:creator><![CDATA[JonB]]></dc:creator><pubDate>Sat, 28 Sep 2019 14:22:22 GMT</pubDate></item><item><title><![CDATA[Reply to How to run background process when a Dialog is showed on Sat, 28 Sep 2019 10:50:09 GMT]]></title><description><![CDATA[<p dir="auto">Hi<br />
What do you want to run in the background ?<br />
Is it a single function ? or its some class that can process something?</p>
<p dir="auto">What did you already try ?</p>
<p dir="auto">Show some code.</p>
]]></description><link>https://forum.qt.io/post/553363</link><guid isPermaLink="true">https://forum.qt.io/post/553363</guid><dc:creator><![CDATA[mrjj]]></dc:creator><pubDate>Sat, 28 Sep 2019 10:50:09 GMT</pubDate></item><item><title><![CDATA[Reply to How to run background process when a Dialog is showed on Sat, 28 Sep 2019 05:05:06 GMT]]></title><description><![CDATA[<p dir="auto">@LeLev said in <a href="/post/553025">How to run background process when a Dialog is showed</a>:</p>
<blockquote>
<p dir="auto">No need to use threads here as QProcess has an asynchronous API</p>
</blockquote>
<p dir="auto">Process means in this case i meant the tasks that are done by me</p>
]]></description><link>https://forum.qt.io/post/553341</link><guid isPermaLink="true">https://forum.qt.io/post/553341</guid><dc:creator><![CDATA[ManiRon]]></dc:creator><pubDate>Sat, 28 Sep 2019 05:05:06 GMT</pubDate></item><item><title><![CDATA[Reply to How to run background process when a Dialog is showed on Thu, 26 Sep 2019 13:05:42 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/jsulm">@<bdi>jsulm</bdi></a> said in <a href="/post/552985">How to run background process when a Dialog is showed</a>:</p>
<blockquote>
<p dir="auto">No need to use threads here as QProcess has an asynchronous API</p>
</blockquote>
<p dir="auto">sorry, my bad, i thought <a class="plugin-mentions-user plugin-mentions-a" href="/user/maniron">@<bdi>ManiRon</bdi></a> was referring to some code/method by 'process'</p>
]]></description><link>https://forum.qt.io/post/553025</link><guid isPermaLink="true">https://forum.qt.io/post/553025</guid><dc:creator><![CDATA[ODБOï]]></dc:creator><pubDate>Thu, 26 Sep 2019 13:05:42 GMT</pubDate></item><item><title><![CDATA[Reply to How to run background process when a Dialog is showed on Thu, 26 Sep 2019 10:42:02 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/maniron">@<bdi>ManiRon</bdi></a> said in <a href="/post/552966">How to run background process when a Dialog is showed</a>:</p>
<blockquote>
<p dir="auto">in which way this can be done ?</p>
</blockquote>
<p dir="auto">Using QProcess. So, please show what you did and tell us what did not work.</p>
]]></description><link>https://forum.qt.io/post/552987</link><guid isPermaLink="true">https://forum.qt.io/post/552987</guid><dc:creator><![CDATA[jsulm]]></dc:creator><pubDate>Thu, 26 Sep 2019 10:42:02 GMT</pubDate></item><item><title><![CDATA[Reply to How to run background process when a Dialog is showed on Thu, 26 Sep 2019 10:41:17 GMT]]></title><description><![CDATA[<p dir="auto">@LeLev said in <a href="/post/552968">How to run background process when a Dialog is showed</a>:</p>
<blockquote>
<p dir="auto">reimplement the showEvent and run your task/code in QConcurent or QThread</p>
</blockquote>
<p dir="auto">No need to use threads here as QProcess has an asynchronous API</p>
]]></description><link>https://forum.qt.io/post/552985</link><guid isPermaLink="true">https://forum.qt.io/post/552985</guid><dc:creator><![CDATA[jsulm]]></dc:creator><pubDate>Thu, 26 Sep 2019 10:41:17 GMT</pubDate></item><item><title><![CDATA[Reply to How to run background process when a Dialog is showed on Thu, 26 Sep 2019 09:26:22 GMT]]></title><description><![CDATA[<p dir="auto">hi<br />
<a class="plugin-mentions-user plugin-mentions-a" href="/user/maniron">@<bdi>ManiRon</bdi></a> said in <a href="/post/552966">How to run background process when a Dialog is showed</a>:</p>
<blockquote>
<p dir="auto">I tried to run a process when a dialog is showed</p>
</blockquote>
<p dir="auto">how ?</p>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/maniron">@<bdi>ManiRon</bdi></a> said in <a href="/post/552966">How to run background process when a Dialog is showed</a>:</p>
<blockquote>
<p dir="auto">But it didnt work</p>
</blockquote>
<p dir="auto">more precisely ?</p>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/maniron">@<bdi>ManiRon</bdi></a> said in <a href="/post/552966">How to run background process when a Dialog is showed</a>:</p>
<blockquote>
<p dir="auto">i want to run the background process also</p>
</blockquote>
<p dir="auto">reimplement the <a href="https://doc.qt.io/qt-5/qwidget.html#showEvent" target="_blank" rel="noopener noreferrer nofollow ugc">showEvent</a> and run your task/code in <a href="https://doc.qt.io/qt-5/qtconcurrentrun.html" target="_blank" rel="noopener noreferrer nofollow ugc">QConcurent</a> or <a href="https://doc.qt.io/qt-5/qthread.html" target="_blank" rel="noopener noreferrer nofollow ugc">QThread</a></p>
]]></description><link>https://forum.qt.io/post/552968</link><guid isPermaLink="true">https://forum.qt.io/post/552968</guid><dc:creator><![CDATA[ODБOï]]></dc:creator><pubDate>Thu, 26 Sep 2019 09:26:22 GMT</pubDate></item></channel></rss>