<div dir="ltr"><div>What happens if you change the connection type to Qt.QueuedConnection? Does that help?<br></div>I think the direct connection is what is causing the problem.<br><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Apr 4, 2015 at 8:24 PM, redstone-cold <span dir="ltr"><<a href="mailto:redstone-cold@163.com" target="_blank">redstone-cold@163.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div><pre style="color:rgb(0,0,0);font-family:Microsoft Yahei,微软雅黑,verdana;font-size:16px;word-break:break-word;font-stretch:normal;line-height:24px;padding:8px 10px;margin-top:0px;margin-bottom:0px"><br></pre><pre style="color:rgb(0,0,0);font-family:Microsoft Yahei,微软雅黑,verdana;font-size:16px;word-break:break-word;font-stretch:normal;line-height:24px;padding:8px 10px;margin-top:0px;margin-bottom:0px">no matter decorated with @pyqtSlot() or not in PyQt5, this code throw out error </pre><span class=""><pre style="color:rgb(0,0,0);font-family:Microsoft Yahei,微软雅黑,verdana;font-size:16px;word-break:break-word;font-stretch:normal;line-height:24px;padding:8px 10px;margin-top:0px;margin-bottom:0px"><span style="font-family:arial;font-size:14px;line-height:23.7999992370605px;white-space:normal"> Traceback (most recent call last):</span><br style="font-family:arial;font-size:14px;line-height:23.7999992370605px;white-space:normal"><span style="font-family:arial;font-size:14px;line-height:23.7999992370605px;white-space:normal"> File "test.py", line 39, in on_deleteTasks_triggered</span><br style="font-family:arial;font-size:14px;line-height:23.7999992370605px;white-space:normal"><span style="font-family:arial;font-size:14px;line-height:23.7999992370605px;white-space:normal"> reply.abort()</span><br style="font-family:arial;font-size:14px;line-height:23.7999992370605px;white-space:normal"><span style="font-family:arial;font-size:14px;line-height:23.7999992370605px;white-space:normal"> AttributeError: 'QAction' object has no attribute 'abort'</span></pre></span><pre style="color:rgb(0,0,0);font-family:Microsoft Yahei,微软雅黑,verdana;font-size:16px;word-break:break-word;font-stretch:normal;line-height:24px;padding:8px 10px;margin-top:0px;margin-bottom:0px"><a href="https://bpaste.net/show/73e54a08957d" target="_blank">https://bpaste.net/show/73e54a08957d</a></pre></div><div style="color:rgb(0,0,0);font-family:arial;font-size:14px"><br></div><div style="color:rgb(0,0,0);font-family:arial;font-size:14px"><br></div><div style="color:rgb(0,0,0);font-family:arial;font-size:14px"><br></div></div><span class="im HOEnZb"><div>在2015年04月04 22时14分, "Yuya Nishihara"<<a href="mailto:yuya@tcha.org" target="_blank">yuya@tcha.org</a>>写道:</div></span><div class="HOEnZb"><div class="h5"><blockquote style="padding-left:1ex;margin:0px 0px 0px 0.8ex;BORDER-LEFT:#ccc 1px solid"><br>On Sat, 4 Apr 2015 21:37:41 +0800 (CST), redstone-cold wrote:<br>> The PyQt4 version of the same code , self.sender() returns a QNetworkReply,<br>> the direct object that sent the signal,while in PyQt5,it returns the<br>> original object that sent the signal.<br><br>I see no difference between PyQt4 and PyQt5. Both crashed because self.sender()<br>is a QAction in on_deleteTasks_triggered(), which is correct.<br><br> Traceback (most recent call last):<br> File "test.py", line 39, in on_deleteTasks_triggered<br> reply.abort()<br> AttributeError: 'QAction' object has no attribute 'abort'<br><br>> here, on_deleteTasks_triggered() call reply.abort(), thus emitted finished<br>> signal of reply, then slotFinished() was invoked, so I think the original<br>> object that sent the signal was QAction, the direct one should be<br>> QNetworkReply, QObject::sender() should return the DIRECT object that sent<br>> the signal in this case or else cause so many problems .<br><br>What happens if slotFinished() is decorated as @pyqtSlot() ?<br><br>> <a href="https://bpaste.net/show/9605c5d7e849" target="_blank">https://bpaste.net/show/9605c5d7e849</a><br></blockquote><div><br><br><span title="neteasefooter"><span></span></span></div><br><br><span title="neteasefooter"><span></span></span></div></div><br>_______________________________________________<br>
PyQt mailing list <a href="mailto:PyQt@riverbankcomputing.com">PyQt@riverbankcomputing.com</a><br>
<a href="http://www.riverbankcomputing.com/mailman/listinfo/pyqt" target="_blank">http://www.riverbankcomputing.com/mailman/listinfo/pyqt</a><br></blockquote></div><br></div>