[PyQt] new style signal/slot and sender() method

Phil Thompson phil at riverbankcomputing.com
Fri Aug 27 17:23:50 BST 2010


On Fri, 27 Aug 2010 17:14:40 +0200, Erik Janssens
<Erik.Janssens at conceptive.be> wrote:
> Hi,
> 
> We are switching our codebase to new style signal/slot and
> this is a strange issue.
> 
> When connecting a QComboBox currentIndexChanged signal to
> a slot :
> 
>     def granularity_changed(self, idx):
>         granularity = self.sender().get_value()
> 
> sender returns the right object, however, when using
> the pyqtSlot decorator :
> 
>     @QtCore.pyqtSlot(int)
>     def granularity_changed(self, idx):
>         granularity = self.sender().get_value()
> 
> sender returns None.
> 
> Is this a known issue ?  If so, can anybody shed some light
> on the reasoning behind this ?

As far as I am aware this was fixed in PyQt v4.7.4.

Phil


More information about the PyQt mailing list