##// END OF EJS Templates
Merge pull request #10301 from tacaswell/qt_eventloop_tweak...
Matthias Bussonnier -
r23381:0408354c merge
parent child Browse files
Show More
@@ -5,6 +5,7 b' from IPython.external.qt_for_kernel import QtCore, QtGui'
5 # garbage collected.
5 # garbage collected.
6 _appref = None
6 _appref = None
7
7
8
8 def inputhook(context):
9 def inputhook(context):
9 global _appref
10 global _appref
10 app = QtCore.QCoreApplication.instance()
11 app = QtCore.QCoreApplication.instance()
@@ -24,7 +25,11 b' def inputhook(context):'
24 else:
25 else:
25 # On POSIX platforms, we can use a file descriptor to quit the event
26 # On POSIX platforms, we can use a file descriptor to quit the event
26 # loop when there is input ready to read.
27 # loop when there is input ready to read.
27 notifier = QtCore.QSocketNotifier(context.fileno(), QtCore.QSocketNotifier.Read)
28 notifier = QtCore.QSocketNotifier(context.fileno(),
28 notifier.setEnabled(True)
29 QtCore.QSocketNotifier.Read)
30 # connect the callback we care about before we turn it on
29 notifier.activated.connect(event_loop.exit)
31 notifier.activated.connect(event_loop.exit)
30 event_loop.exec_()
32 notifier.setEnabled(True)
33 # only start the event loop we are not already flipped
34 if not context.input_is_ready():
35 event_loop.exec_()
General Comments 0
You need to be logged in to leave comments. Login now