Hi,
I am observing an issue disconnecting a signal using the new style signal-
slots API. If the signal to be disconnected is not connected, I am getting a
TypeError exception. Using the old style API, the code silently ignores the
disconnect. The little script in the attachment shows the issue by commenting
the various lines in the disconnect_method method. Is there a method to check,
if a signal-slot connection has been established (e.g.
mySignal.isConnected(slot) )?
Regards,
Detlev
--
Detlev Offenbach
[email protected]
# -*- coding: utf-8 -*-
from PyQt4.QtCore import QObject, pyqtSignal, SIGNAL
class TestClass(QObject):
mySignal = pyqtSignal()
def __init__(self, parent=None):
QObject.__init__(self, parent)
def __handler(self):
pass
def disconnect_method(self):
## self.disconnect(self, SIGNAL("mySignal()"), self.__handler)
## self.mySignal.disconnect()
self.mySignal.disconnect(self.__handler)
if __name__ == "__main__":
obj = TestClass()
obj.disconnect_method()
_______________________________________________
PyQt mailing list [email protected]
http://www.riverbankcomputing.com/mailman/listinfo/pyqt