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

Yuya Nishihara yuya at tcha.org
Sun Apr 5 12:10:16 BST 2015


On Sun, 5 Apr 2015 11:17:18 +0800 (CST), redstone-cold wrote:
> sorry ,I posted the wrong code last time, this is the right code 
> https://bpaste.net/show/a8a5c72f9c0c
> for slotFinished() if decorated with @pyqtSlot() in PyQt5 seems works fine ,
> but if not ,
> 
> Traceback (most recent call last):
>   File "E:\network.py", line 57, in slotFinished
>     print(reply, reply.error())
> AttributeError: 'QAction' object has no attribute 'error'
> 
> PyQt4 doesn't care if  slotFinished() decorated with @pyqtSlot() or not ,
> while PyQt5 does ,anyone can explain why ?

Perhaps, reply.abort() doesn't emit finished() immediately (i.e. in the same
call stack) on your Qt4 environment. My PyQt4 has the same issue.

  Debian Linux sid
  libqt4-core 4:4.8.6+git64-g5dc8b2b+dfsg-3
  python-qt4 4.11.2+dfsg-1

Regards,


More information about the PyQt mailing list