Skip to content

Instantly share code, notes, and snippets.

Created March 12, 2013 19:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/5146031 to your computer and use it in GitHub Desktop.
Save anonymous/5146031 to your computer and use it in GitHub Desktop.
qtgui.py
restart_code = 1000
@staticmethod
def application_main():
"""
The application's main function.
Create application and main window and run them.
"""
while True:
app = QApplication(sys.argv)
window = GuiMain()
window.show()
ret = app.exec_()
print ret
if ret != GuiMain.restart_code:
break
@eike-welk
Copy link

When I call QApplication.exit(GuiMain.restart_code) the application terminates with exit value: 134, and message:

QWidget: Must construct a QApplication before a QPaintDevice

I think QApplication can't be restarted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment