[PyQt] [PyQt 4.5] TypeError: pyqtBoundSignal cannot be converted to QObject in this context

Alexandr N Zamaraev tonal at promsoft.ru
Fri Apr 10 06:06:37 BST 2009


Phil Thompson wrote:
>>    def __connectAll(self):
>>      for dm in (self.__phys, self.__jur, self.__bus):
>>        dm.data_adds.connect(self.data_adds.emit)
> 
> I don't understand what you are trying to do in the last line.
It may well be more intuitive:
[code]
class DataLink(QtCore.QObject):
   data_adds = QtCore.QtCore.pyqtSignal(frozenset)
...
   def addObjects(self, objs):
     obj_oids = self._internalAddObjects(objs, *args, **kwd)
     self.data_adds.emit(obj_oids)
...
class DataPhys(DataLink): pass
class DataJur(DataLink): pass
class DataBus(DataLink): pass

class DataPerson(DataLink):
   __phys = None
   __jur = None
   __bus = None
   def __init__(self):
     super(DataPerson, self, phys, jur, bus).__init__()
     self.__phys = phys or DataPhys()
     self.__jur = jur or DataJur()
     self.__bus = bus or DatadBus()
     self.__connectAll()

   def __connectAll(self):
     for dm in (self.__phys, self.__jur, self.__bus):
       dm.data_adds.connect(self.data_adds.emit)
[/code]
I need to retransmit signals from the members.


More information about the PyQt mailing list