[PyQt] Bug obtaining signal's sender with decorated slots (was: self.sender() with new connect/signal)

Phil Thompson phil at riverbankcomputing.com
Tue Jun 29 12:51:31 BST 2010


On Fri, 25 Jun 2010 00:24:59 +0200, Albert Cervera i Areny
<albert at nan-tic.com> wrote:
> A Diumenge, 20 de juny de 2010, Albert Cervera i Areny va escriure:
>> We're changing an application from using old-style 'connect(SIGNAL()
>> SLOT())' functions to new-style 'signal.connect( slot )' ones but it
>> seems that executing 'self.sender()' in the slot doesn't have the same
>> behaviour as it used to because it always returns None.
>> 
>> Is there a way to know who called the slot with new-style signal and
>> slot?
> 
> The attached file demonstrates the problem. sender() function doesn't
work
> if 
> signal is emited using the new-style signal.emit() and the slot is
> decorated 
> using @pyqtSlot()

Should be fixed in tonight's PyQt snapshot.

Thanks,
Phil


More information about the PyQt mailing list