[prev in list] [next in list] [prev in thread] [next in thread]
List: pykde
Subject: Re: [PyQt] Type information for signals
From: Phil Thompson <phil () riverbankcomputing ! com>
Date: 2012-04-25 7:40:06
Message-ID: 38aef88443995f7d4eb61b8ef4df1bea () localhost
[Download RAW message or body]
On Sun, 22 Apr 2012 08:54:44 +0100, Andrew Suffield
<asuffield@suffields.me.uk> wrote:
> I'd rather like to be able to write code like this:
>
> for name in dir(obj):
> a = getattr(obj, name)
> if isinstance(a, QtCore.pyqtSignal):
> setattr(self, name, a)
>
> Unfortunately, signals of objects are of class pyqtBoundSignal and I
> can't find a class object to pass to isinstance - does it exist?
No, easy to add.
> For similar purposes of metaclass hackery, it would be useful to get
> the string form out of a signal object so that I can call functions
> like QObject.connectNotify and QObject.receivers
So a __signal__ attribute to pyqtBoundSignal?
Should the value of the attribute already have the SIGNAL() macro applied
to it?
Phil
_______________________________________________
PyQt mailing list PyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic