[PyQt] Waiting For A Signal

Bryan A. Jones bjones at ece.msstate.edu
Wed May 28 17:13:05 BST 2014


All,

Here's a snippet from some test code that works for me. Is this what you
were thinking? See
https://github.com/hlamer/enki/blob/master/tests/base.pystarting at
line 285, waitForSignal().

Bryan


On Wed, May 21, 2014 at 10:33 AM, Robert Kent <rob at gulon.co.uk> wrote:

> 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
>
>
> _______________________________________________
> PyQt mailing list    PyQt at riverbankcomputing.com
> http://www.riverbankcomputing.com/mailman/listinfo/pyqt
>



-- 
Bryan A. Jones, Ph.D.
Associate Professor
Department of Electrical and Computer Engineering
231 Simrall / PO Box 9571
Mississippi State University
Mississippi state, MS 39762
http://www.ece.msstate.edu/~bjones
bjones AT ece DOT msstate DOT edu
voice 662-325-3149
fax 662-325-2298

Our Master, Jesus Christ, is on his way. He'll show up right on
time, his arrival guaranteed by the Blessed and Undisputed Ruler,
High King, High God.
- 1 Tim. 6:14b-15 (The Message)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20140528/2c524f23/attachment.html>


More information about the PyQt mailing list