[PyQt] How to disconnect all connected signals of an object

Phil Thompson phil at riverbankcomputing.com
Wed Apr 13 18:30:09 BST 2011


On Wed, 13 Apr 2011 19:20:22 +0200, Detlev Offenbach
<detlev at die-offenbachs.de> wrote:
> Hello,
> 
> what is the correct way to disconnect all signal connected to an object?
I 
> tried it with code like
> 
> browser.disconnect()
> 
> but that raises an exception
> 
> TypeError
> "arguments did not match any overloaded call:
QObject.disconnect(QObject, 
> SIGNAL(), QObject, SLOT()): not enough arguments
> QObject.disconnect(QObject, 
> SIGNAL(), callable): not enough arguments"
> 
> According to the Qt documentation that should work. Please note, that my
> code 
> uses new-style signal/slots.
> 
> Regards,
> Detlev

You can only disconnect all connections to a particular signal...

browser.signal.disconnect()

Phil


More information about the PyQt mailing list