[PyKDE] QObject.disconnect()
alexander krohn
ak at e-dict.net
Thu Oct 5 14:55:00 BST 2006
hi.
i want to use the 'universal disconnect', but can't get it to work.
maybe i've missed something. i want to disconnect several python-slots
from python-signals.
any comments?
thanks in advance.
cheers,
alexander
ps: here is what i've tested:
from PyQt4 import QtCore
class A(QtCore.QObject):
def __init__(self, i):
QtCore.QObject.__init__(self)
self.i = i
def slotBla(self):
print "bla(%i)" % self.i
def emitBla(self):
self.emit(QtCore.SIGNAL("bla()"))
if __name__ == '__main__':
# build some instances
a1 = A(1)
a2 = A(2)
# connect them
a2.connect(a1, QtCore.SIGNAL("bla()"), a2.slotBla)
# test the signal
a1.emitBla()
# how to disconnect? none of the following works
a2.disconnect()
a2.disconnect(QtCore.SIGNAL("bla()"))
More information about the PyQt
mailing list