<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; color: rgb(0, 0, 0); font-size: 14px; font-family: Calibri, sans-serif; "><div>Hi Marc,</div><div><br></div><div>Thanks for your reply. I am actually quite well versed in threading and it is precisely this that I am trying to avoid. The 2nd event loop and signal waiter mechanisms both work beautifully in C++, I was just wondering what the difference was in PyQt and if it was avoidable. I can actually achieve my aim using callbacks rather than threads, but its not as neat. I'm aware that I essentially want to have my cake and eat it, I was just wondering if anyone else had encountered and/or come up with a solution.</div><div><br></div><div>Thanks again, Rob</div><div><br></div><span id="OLK_SRC_BODY_SECTION"><div style="font-family:Calibri; font-size:11pt; text-align:left; color:black; BORDER-BOTTOM: medium none; BORDER-LEFT: medium none; PADDING-BOTTOM: 0in; PADDING-LEFT: 0in; PADDING-RIGHT: 0in; BORDER-TOP: #b5c4df 1pt solid; BORDER-RIGHT: medium none; PADDING-TOP: 3pt"><span style="font-weight:bold">From: </span> Marc Thomas <<a href="mailto:jazzyflute@gmail.com">jazzyflute@gmail.com</a>><br><span style="font-weight:bold">Date: </span> Wednesday, 21 May 2014 14:47<br><span style="font-weight:bold">To: </span> Robert Kent <<a href="mailto:rob@gulon.co.uk">rob@gulon.co.uk</a>><br><span style="font-weight:bold">Cc: </span> pyqt <<a href="mailto:pyqt@riverbankcomputing.com">pyqt@riverbankcomputing.com</a>><br><span style="font-weight:bold">Subject: </span> Re: [PyQt] Waiting For A Signal<br></div><div><br></div><div dir="ltr"><div><div><div>Hey Robert,<br><br></div>You are going to want to loop into threading. Essentially what is happening right now is that your main thread (GUI thread) is kicking off a process that runs for a while. While that process is happening, nothing else can happen. If you multi-thread your application, you can kick that process off in the background thus not locking up your GUI. <br><br>Here is an example of PyQt4 multi-threading I have written:
<a href="http://pastebin.com/YFASwSb9">http://pastebin.com/YFASwSb9</a><br>This is good tutorial explaining the different components of multi-threading with PyQT: <a href="http://joplaete.wordpress.com/2010/07/21/threading-with-pyqt4/">http://joplaete.wordpress.com/2010/07/21/threading-with-pyqt4/</a><br></div><br></div>Hope this helps!<br><br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, May 20, 2014 at 12:30 PM, Robert Kent <span dir="ltr"><<a href="mailto:rob@gulon.co.uk" target="_blank">rob@gulon.co.uk</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word;color:rgb(0,0,0);font-size:14px;font-family:Calibri,sans-serif"><div>Hi All,</div><div><br></div><div>As the subject line of suggests, I want to wait for a signal to be emitted (block essentially), but I want to do this whilst keeping the GUI alive. I have tried both creating my own event loop and re-implelmenting libqxt's QxtSignalWaiter, but my signal of choice is never caught until after either the event loop has quit of the signal waiter has stopped waiting. I'm guessing this is something to do with the way the event loop is executed in PyQt (or I'm doing something very wrong ;o). Has anyone had any success or experience with doing this in Python (I've done it before in C++).</div><div><br></div><div>Thanks, Rob</div></div><br>_______________________________________________<br>
PyQt mailing list <a href="mailto:PyQt@riverbankcomputing.com">PyQt@riverbankcomputing.com</a><br><a href="http://www.riverbankcomputing.com/mailman/listinfo/pyqt" target="_blank">http://www.riverbankcomputing.com/mailman/listinfo/pyqt</a><br></blockquote></div><br><br clear="all"><br>-- <br><div dir="ltr"><a href="http://mathomaste.ch" target="_blank">Website</a> : <a href="https://plus.google.com/u/0/103260909450809151378/about" target="_blank">Google+</a> : <a href="https://twitter.com/mathomastech" target="_blank">Twitter</a> : <a href="https://github.com/mathomastech" target="_blank">GitHub</a><br></div></div></span></body></html>