added ipython support for developing

This commit is contained in:
Marcel Paffrath 2017-04-10 13:32:53 +02:00
parent 3f7a61736a
commit 50d3c5f235
2 changed files with 18 additions and 3 deletions

View File

@ -1160,9 +1160,23 @@ class MainWindow(QMainWindow):
form.show() form.show()
def create_window():
app_created = False
app = QCoreApplication.instance()
#check for existing app (when using ipython)
if app is None:
app = QApplication(sys.argv)
app_created = True
app.references = set()
#app.references.add(window)
#window.show()
return app, app_created
def main(): def main():
# create the Qt application # create the Qt application
pylot_app = QApplication(sys.argv) pylot_app, app_created = create_window()
#pylot_app = QApplication(sys.argv)
pixmap = QPixmap(":/splash/splash.png") pixmap = QPixmap(":/splash/splash.png")
splash = QSplashScreen(pixmap) splash = QSplashScreen(pixmap)
splash.show() splash.show()
@ -1193,6 +1207,7 @@ def main():
pylot_app.processEvents() pylot_app.processEvents()
splash.finish(pylot_form) splash.finish(pylot_form)
if app_created:
pylot_app.exec_() pylot_app.exec_()

View File

@ -1 +1 @@
49a4-dirty 3f7a-dirty