[PyQt] Type information for signals

Andrew Suffield asuffield at suffields.me.uk
Sun Apr 22 08:54:44 BST 2012

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?

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

More information about the PyQt mailing list