[PyQt] Python has stopped working in PyQt application

redstone-cold redstone-cold at 163.com
Mon Mar 30 09:55:52 BST 2015


code like the following .After it  running for about half a minute ,then close the window, then the "Python has stopped working" dialog pops up(you had better try more than once. )
 I wonder why this happen ?any solution to this ?






fromPyQt4.QtCoreimport*fromPyQt4.QtGuiimport*classMainWindow(QMainWindow):def__init__(self):super().__init__()self.setWindowIcon(QIcon("./wa.png"))self.createTrayIcon()defcreateTrayIcon(self):self.trayIcon=QSystemTrayIcon()self.trayIcon.setIcon(self.windowIcon())self.trayIcon.show()if__name__=="__main__":importsysapp=QApplication(sys.argv)ui=MainWindow()ui.show()sys.exit(app.exec_())



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20150330/e7c892a3/attachment.html>


More information about the PyQt mailing list