[PyKDE] Signals and Slots in PyQt4

Baz Walter bazwal at ftml.net
Sun Dec 18 18:33:29 GMT 2005


Hello

When disconnecting a signal from a python slot, if the connection has not already been made, it produces the error: 'RuntimeError: Slot hasn't been connected'. However, QObject.disconnect gives a boolean result on success/failure. So is this error really necessary? (With unconnected qt slots, disconnect just returns false).

Also, given that PYSIGNAL has been removed from PyQt4, would it now make sense to support the full SIGNAL/SLOT syntax for python member functions? That is, if MyCustomClass emits a "stuffHappened" signal, should it be possible to connect it to MyCustomClass.handleStuff() like this:

	self.connect(self, QtCore.SIGNAL("stuffHappened"),
		     self, QtCore.SLOT("handleStuff"))

This syntax isn't all sugar. It's also more flexible if the receiver object and the slot can be passed independantly.  


Regards
-- 
Baz Walter
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20051218/2df380fd/attachment.html


More information about the PyQt mailing list