<?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[[SOLVED] Wait for timeout or some signal]]></title><description><![CDATA[<p dir="auto">Hi All!<br />
I need send some message by the local net, and than need wait to some answer or exit at the function by timeout,<br />
I try stop by forever loop, and there wait some signals, but no signal is comming (i think thats because i create this loop at the main thread), i want to try create wait loop and timeout timer not at the main threads, but i don't like this idea,  some one can tall me easy way to resolve this problem?</p>
]]></description><link>https://forum.qt.io/topic/12742/solved-wait-for-timeout-or-some-signal</link><generator>RSS for Node</generator><lastBuildDate>Sun, 06 Sep 2026 15:26:36 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/12742.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 03 Jan 2012 09:33:31 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to [SOLVED] Wait for timeout or some signal on Fri, 31 Oct 2014 09:54:45 GMT]]></title><description><![CDATA[<p dir="auto">[quote author="Andre" date="1357286986"]Yes, I know where to find the sources and I know the docs, but that was not my question. I sometimes use this idea:<br />
@<br />
QEventLoop loop;<br />
connect(myObject, SIGNAL(theSignalToWaitFor()), &amp;loop, SLOT(quit()));<br />
connect(timeoutTimer, SIGNAL(timeout()), &amp;loop, SLOT(quit()));<br />
loop.exec(); //blocks untill either theSignalToWaitFor or timeout was fired<br />
@</p>
<p dir="auto">[/quote]</p>
<p dir="auto">thank you. it's very useful.</p>
]]></description><link>https://forum.qt.io/post/126739</link><guid isPermaLink="true">https://forum.qt.io/post/126739</guid><dc:creator><![CDATA[[[global:former-user]]]]></dc:creator><pubDate>Fri, 31 Oct 2014 09:54:45 GMT</pubDate></item><item><title><![CDATA[Reply to [SOLVED] Wait for timeout or some signal on Fri, 04 Jan 2013 08:09:46 GMT]]></title><description><![CDATA[<p dir="auto">Yes, I know where to find the sources and I know the docs, but that was not my question. I sometimes use this idea:<br />
@<br />
QEventLoop loop;<br />
connect(myObject, SIGNAL(theSignalToWaitFor()), &amp;loop, SLOT(quit()));<br />
connect(timeoutTimer, SIGNAL(timeout()), &amp;loop, SLOT(quit()));<br />
loop.exec(); //blocks untill either theSignalToWaitFor or timeout was fired<br />
@</p>
]]></description><link>https://forum.qt.io/post/126074</link><guid isPermaLink="true">https://forum.qt.io/post/126074</guid><dc:creator><![CDATA[andre]]></dc:creator><pubDate>Fri, 04 Jan 2013 08:09:46 GMT</pubDate></item><item><title><![CDATA[Reply to [SOLVED] Wait for timeout or some signal on Thu, 03 Jan 2013 19:46:59 GMT]]></title><description><![CDATA[<p dir="auto">See "this":<a href="http://dev.libqxt.org/libqxt/src/21ea5919eabb2a404eafdffcdb8383472ca66bdd/src/core/qxtsignalwaiter.cpp?at=master#cl-143" target="_blank" rel="noopener noreferrer nofollow ugc">http://dev.libqxt.org/libqxt/src/21ea5919eabb2a404eafdffcdb8383472ca66bdd/src/core/qxtsignalwaiter.cpp?at=master#cl-143</a> and read the doc about WaitForMoreEvents "here":<a href="http://qt-project.org/doc/qt-4.8/qeventloop.html#ProcessEventsFlag-enum" target="_blank" rel="noopener noreferrer nofollow ugc">http://qt-project.org/doc/qt-4.8/qeventloop.html#ProcessEventsFlag-enum</a>.</p>
]]></description><link>https://forum.qt.io/post/126070</link><guid isPermaLink="true">https://forum.qt.io/post/126070</guid><dc:creator><![CDATA[[[global:former-user]]]]></dc:creator><pubDate>Thu, 03 Jan 2013 19:46:59 GMT</pubDate></item><item><title><![CDATA[Reply to [SOLVED] Wait for timeout or some signal on Thu, 03 Jan 2013 15:35:43 GMT]]></title><description><![CDATA[<p dir="auto">[quote author="RomaHagen" date="1357227120"]QxtSignalWaiter is implemented with a help of processEvents, not eventLoop. See "here":<a href="http://dev.libqxt.org/libqxt/src/21ea5919eabb2a404eafdffcdb8383472ca66bdd/src/core/qxtsignalwaiter.cpp?at=master#cl-143" target="_blank" rel="noopener noreferrer nofollow ugc">http://dev.libqxt.org/libqxt/src/21ea5919eabb2a404eafdffcdb8383472ca66bdd/src/core/qxtsignalwaiter.cpp?at=master#cl-143</a>. [/quote]</p>
<p dir="auto">Hmmm... You're right. Surprising. Thanks for the correction.</p>
<p dir="auto">Does anyone know why Qxt choose this implementation instead?</p>
]]></description><link>https://forum.qt.io/post/126069</link><guid isPermaLink="true">https://forum.qt.io/post/126069</guid><dc:creator><![CDATA[andre]]></dc:creator><pubDate>Thu, 03 Jan 2013 15:35:43 GMT</pubDate></item><item><title><![CDATA[Reply to [SOLVED] Wait for timeout or some signal on Thu, 03 Jan 2013 15:32:00 GMT]]></title><description><![CDATA[<p dir="auto">QxtSignalWaiter is implemented with a help of processEvents, not eventLoop. See "here":<a href="http://dev.libqxt.org/libqxt/src/21ea5919eabb2a404eafdffcdb8383472ca66bdd/src/core/qxtsignalwaiter.cpp?at=master#cl-143" target="_blank" rel="noopener noreferrer nofollow ugc">http://dev.libqxt.org/libqxt/src/21ea5919eabb2a404eafdffcdb8383472ca66bdd/src/core/qxtsignalwaiter.cpp?at=master#cl-143</a>.</p>
]]></description><link>https://forum.qt.io/post/126068</link><guid isPermaLink="true">https://forum.qt.io/post/126068</guid><dc:creator><![CDATA[[[global:former-user]]]]></dc:creator><pubDate>Thu, 03 Jan 2013 15:32:00 GMT</pubDate></item><item><title><![CDATA[Reply to [SOLVED] Wait for timeout or some signal on Tue, 03 Jan 2012 17:49:08 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/andre">@<bdi>Andre</bdi></a>,<br />
Thanks, feel like got good things to know and even another useful-looking library!</p>
]]></description><link>https://forum.qt.io/post/122664</link><guid isPermaLink="true">https://forum.qt.io/post/122664</guid><dc:creator><![CDATA[joonhwan]]></dc:creator><pubDate>Tue, 03 Jan 2012 17:49:08 GMT</pubDate></item><item><title><![CDATA[Reply to [SOLVED] Wait for timeout or some signal on Tue, 03 Jan 2012 13:13:28 GMT]]></title><description><![CDATA[<p dir="auto">Calling <em>processEvents()</em> in a loop like proposed will keep your CPU 100% bussy, because you just keep polling the event queue. Using an eventloop is a smarter solution that doesn't waste CPU cycles like that, so it will not spike your CPU. It is also the solution implemented by the libQxt in QxtSignalWaiter.</p>
]]></description><link>https://forum.qt.io/post/122626</link><guid isPermaLink="true">https://forum.qt.io/post/122626</guid><dc:creator><![CDATA[andre]]></dc:creator><pubDate>Tue, 03 Jan 2012 13:13:28 GMT</pubDate></item><item><title><![CDATA[Reply to [SOLVED] Wait for timeout or some signal on Tue, 03 Jan 2012 13:05:34 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/rich">@<bdi>rich</bdi></a>,<br />
Can hear more details of using processEvents() and QEventLoop story here?</p>
]]></description><link>https://forum.qt.io/post/122624</link><guid isPermaLink="true">https://forum.qt.io/post/122624</guid><dc:creator><![CDATA[joonhwan]]></dc:creator><pubDate>Tue, 03 Jan 2012 13:05:34 GMT</pubDate></item><item><title><![CDATA[Reply to [SOLVED] Wait for timeout or some signal on Tue, 03 Jan 2012 12:13:11 GMT]]></title><description><![CDATA[<p dir="auto">Please don't use processEvents() like this, or your CPU usage will be terrible. Instead use QEventLoop.</p>
]]></description><link>https://forum.qt.io/post/122612</link><guid isPermaLink="true">https://forum.qt.io/post/122612</guid><dc:creator><![CDATA[rich]]></dc:creator><pubDate>Tue, 03 Jan 2012 12:13:11 GMT</pubDate></item><item><title><![CDATA[Reply to [SOLVED] Wait for timeout or some signal on Tue, 03 Jan 2012 10:37:08 GMT]]></title><description><![CDATA[<p dir="auto">tnx a lot!</p>
]]></description><link>https://forum.qt.io/post/122595</link><guid isPermaLink="true">https://forum.qt.io/post/122595</guid><dc:creator><![CDATA[maxim.prishchepa]]></dc:creator><pubDate>Tue, 03 Jan 2012 10:37:08 GMT</pubDate></item><item><title><![CDATA[Reply to [SOLVED] Wait for timeout or some signal on Tue, 03 Jan 2012 10:30:31 GMT]]></title><description><![CDATA[<p dir="auto">Or, look into "QxtSignalWaiter":<a href="http://libqxt.bitbucket.org/doc/0.6/qxtsignalwaiter.html" target="_blank" rel="noopener noreferrer nofollow ugc">http://libqxt.bitbucket.org/doc/0.6/qxtsignalwaiter.html</a> from the libQxt library.</p>
]]></description><link>https://forum.qt.io/post/122593</link><guid isPermaLink="true">https://forum.qt.io/post/122593</guid><dc:creator><![CDATA[andre]]></dc:creator><pubDate>Tue, 03 Jan 2012 10:30:31 GMT</pubDate></item><item><title><![CDATA[Reply to [SOLVED] Wait for timeout or some signal on Tue, 03 Jan 2012 09:48:54 GMT]]></title><description><![CDATA[<p dir="auto">tnx, i note that!</p>
]]></description><link>https://forum.qt.io/post/122586</link><guid isPermaLink="true">https://forum.qt.io/post/122586</guid><dc:creator><![CDATA[maxim.prishchepa]]></dc:creator><pubDate>Tue, 03 Jan 2012 09:48:54 GMT</pubDate></item><item><title><![CDATA[Reply to [SOLVED] Wait for timeout or some signal on Tue, 03 Jan 2012 09:47:37 GMT]]></title><description><![CDATA[<p dir="auto">Yeah, it forces the QCoreApplication instance to process events in the event queue, including signals and slots provided by MOC. This way, the loop does not block operation of the app.</p>
]]></description><link>https://forum.qt.io/post/122584</link><guid isPermaLink="true">https://forum.qt.io/post/122584</guid><dc:creator><![CDATA[sierdzio]]></dc:creator><pubDate>Tue, 03 Jan 2012 09:47:37 GMT</pubDate></item><item><title><![CDATA[Reply to [SOLVED] Wait for timeout or some signal on Tue, 03 Jan 2012 09:46:05 GMT]]></title><description><![CDATA[<p dir="auto">WOW so easy? i'll try that :) thnx</p>
]]></description><link>https://forum.qt.io/post/122585</link><guid isPermaLink="true">https://forum.qt.io/post/122585</guid><dc:creator><![CDATA[maxim.prishchepa]]></dc:creator><pubDate>Tue, 03 Jan 2012 09:46:05 GMT</pubDate></item><item><title><![CDATA[Reply to [SOLVED] Wait for timeout or some signal on Tue, 03 Jan 2012 09:44:47 GMT]]></title><description><![CDATA[<p dir="auto">@<br />
forever {<br />
doMyLogic();<br />
qApp-&gt;processEvents();<br />
}<br />
@</p>
]]></description><link>https://forum.qt.io/post/122583</link><guid isPermaLink="true">https://forum.qt.io/post/122583</guid><dc:creator><![CDATA[sierdzio]]></dc:creator><pubDate>Tue, 03 Jan 2012 09:44:47 GMT</pubDate></item></channel></rss>