[PyQt] Waiting For A Signal

Robert Kent rob at gulon.co.uk
Wed May 21 16:33:07 BST 2014


Hi Francois,

As I said in my original email, I have tried creating my own event loop
using this method and, whilst this works in C++, it does not in Python...
this is my issue and this is the difference I am trying to understand.

Thanks, Rob

On 21/05/2014 16:23, "François K." <daitheflu at free.fr> wrote:

>Hi Robert,
>
>I have a very small experience with PyQt but I think QEventLoop is what
>you're looking for.
>There is a small C++ example here :
>http://doc.qt.digia.com/qq/qq27-responsive-guis.html#waitinginalocaleventl
>oop
>You'll be able to easily "translate" this to Python.
>
>I have used this method once and it worked well.
>
>Hope it helps,
>
>-- 
>François
>
>
>----- Mail original -----
>> De: "Robert Kent" <rob at gulon.co.uk>
>> À: "pyqt" <pyqt at riverbankcomputing.com>
>> Envoyé: Mardi 20 Mai 2014 19:30:25
>> Objet: [PyQt] Waiting For A Signal
>
>> 
>> 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++).
>> 
>> 
>> Thanks, Rob
>> _______________________________________________
>> PyQt mailing list    PyQt at riverbankcomputing.com
>> http://www.riverbankcomputing.com/mailman/listinfo/pyqt




More information about the PyQt mailing list