##// END OF EJS Templates
Create a QApplication for inputhook if one doesn't already exist...
Thomas Kluyver -
Show More
@@ -1,10 +1,15 b''
1 import sys
1 import sys
2 from IPython.external.qt_for_kernel import QtCore, QtGui
2 from IPython.external.qt_for_kernel import QtCore, QtGui
3
3
4 # If we create a QApplication, keep a reference to it so that it doesn't get
5 # garbage collected.
6 _appref = None
7
4 def inputhook(context):
8 def inputhook(context):
9 global _appref
5 app = QtCore.QCoreApplication.instance()
10 app = QtCore.QCoreApplication.instance()
6 if not app:
11 if not app:
7 return
12 _appref = app = QtGui.QApplication([" "])
8 event_loop = QtCore.QEventLoop(app)
13 event_loop = QtCore.QEventLoop(app)
9
14
10 if sys.platform == 'win32':
15 if sys.platform == 'win32':
General Comments 0
You need to be logged in to leave comments. Login now