[PyQt] PyQt5: Connect/disconnect to/from (non slot) builtin method

Phil Thompson phil at riverbankcomputing.com
Mon Feb 15 13:46:51 GMT 2016


On 15 Feb 2016, at 9:09 am, Ales Erjavec <ales.erjavec324 at gmail.com> wrote:
> 
> Hello
> 
> In PyQt5 (5.5.1) connecting a signal to a builtin method (which is not
> defined as a slot)
> and then disconnecting it raises a
> 
>   TypeError: 'builtin_function_or_method' object is not connected
> 
> 
> ####
> 
> from PyQt5 import QtCore
> 
> class Obj(QtCore.QObject):
>    signal = QtCore.pyqtSignal(str)
> 
> obj = Obj()
> 
> obj.signal.connect(obj.setObjectName)
> obj.signal.disconnect(obj.setObjectName)  # raises an error
> 
> ####
> 
> The same code works in PyQt4.

Should be fixed in tonight's snapshot.

Thanks,
Phil


More information about the PyQt mailing list