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

Phil Thompson phil at riverbankcomputing.com
Thu Apr 9 14:02:38 BST 2009


On Thu, 09 Apr 2009 15:13:27 +0700, Alexandr N Zamaraev <tonal at promsoft.ru>
wrote:
> I try port my applications to PyQt 4.5
> And I recive TypeError:
> [code]
> Traceback (most recent call last):
>   ...
>    File 
> "C:\Lang\Projects\Promsoft\mun_ob\doc_circ\src\links\DataRightOwner.py", 
> line 48, in __init__
>      self.__connectAll()
>    File 
> "C:\Lang\Projects\Promsoft\mun_ob\doc_circ\src\links\DataRightOwner.py", 
> line 189, in __connectAll
>      for dm in (self.__phys, self.__jur, self.__bus):
> TypeError: PyQt4.QtCore.pyqtBoundSignal cannot be converted to 
> PyQt4.QtCore.QObject in this context
> [/code]
> 
> How correct this error?
> 
> Snipped Code for illustrate:
> [code]
> class DataLink(QtCore.QObject):
>    data_adds = QtCore.QtCore.pyqtSignal(frozenset)
> 
> class DataRightLandPhys(DataLink): pass
> class DataRightLandJur(DataLink): pass
> class DataRightLandJur(DataLink): pass
> 
> class Data(DataLink):
>    __phys = None
>    __jur = None
>    __bus = None
>    def __init__(self):
>      super(Data, self).__init__()
>      self.__phys = DataRightLandPhys()
>      self.__jur = DataRightLandJur()
>      self.__bus = DataRightLandBus()
>      self.__connectAll()
> 
>    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.

Phil


More information about the PyQt mailing list