[PyQt] QObject::​sender() returns the original object that sent the signal

Phil Thompson phil at riverbankcomputing.com
Fri Feb 13 13:54:20 GMT 2015


On 11/02/2015 3:15 am, iMath wrote:
> In PyQt4,QObject::​sender() returns the direct object that sent the
> signal,while in PyQt5,it  returns the original object that sent the
> signal.
> 
> 
> QObject::​sender() should return the DIRECT object that sent the
> signal or cause so many problems .‍

According to my tests PyQt4 and PyQt5 behave the same. sender() behaves 
differently if you decorate the slot with pyqtSlot(). I haven't quite 
worked out why that is the case.

Phil


More information about the PyQt mailing list