[PyQt] Type name for a function / callable when defining a signal

Bryan A. Jones bjones at ece.msstate.edu
Wed Aug 27 15:23:30 BST 2014


Baz,

Perfect -- just what I needed. Thanks!

Bryan


On Tue, Aug 26, 2014 at 5:04 PM, Baz Walter <bazwal at ftml.net> wrote:

> On 26/08/14 22:25, Bryan A. Jones wrote:
> > All,
> >
> > A simple question -- I'd like to define a signal which expects a function
> > (or any callable) as an argument to the signal. I'm accustomed to
> defining
> > signals with other parameters, such as
> >
> > signalName = pyqtSignal(int, str, list, dict)
> >
> > What's the type for a function?
> >
> > signalName = pyqtSignal(def?) # nope; not 'function' either.
>
> You could use the types module from the stdlib:
>
>      signalName = pyqtSignal(types.FunctionType)
>
> or:
>
>      signalName = pyqtSignal(types.MethodType)
>
> But simplest would be:
>
>      signalName = pyqtSignal(object)
>
> --
> Regards
> Baz Walter
> _______________________________________________
> 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/20140827/439d11fa/attachment.html>


More information about the PyQt mailing list