here is my code, and after close the window, <div>stop method is not triggered as expected. what's wrong?</div><div>windows + pyqt4.5.4<br><div><br><div><span class="Apple-style-span" style="font-family: 'courier new', monospace; font-size: 13px; border-collapse: collapse; ">from PyQt4.QtCore import *<br>
from PyQt4.QtGui import *<br><br>class MyClass(QWidget):<br> def __init__(self):<br> QWidget.__init__(self)<br> self.destroyed.connect(self.stop)<br><br> def stop(self, e=None):<br> print("stoped")<br>
<br>def main():<br> app = QApplication([])<br> c = MyClass()<br> c.show()<br> app.exec_()<br> <br>if __name__=="__main__":<br> main()</span></div></div></div>