[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pykde
Subject:    [PyKDE] QObject.disconnect()
From:       alexander krohn <ak () e-dict ! net>
Date:       2006-10-05 13:55:00
Message-ID: 45250EB4.8000301 () e-dict ! net
[Download RAW message or body]

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()"))

_______________________________________________
PyKDE mailing list    PyKDE@mats.imk.fraunhofer.de
http://mats.imk.fraunhofer.de/mailman/listinfo/pykde
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic