Show More
@@ -5,6 +5,7 b' from IPython.external.qt_for_kernel import QtCore, QtGui' | |||
|
5 | 5 | # garbage collected. |
|
6 | 6 | _appref = None |
|
7 | 7 | |
|
8 | ||
|
8 | 9 | def inputhook(context): |
|
9 | 10 | global _appref |
|
10 | 11 | app = QtCore.QCoreApplication.instance() |
@@ -24,7 +25,11 b' def inputhook(context):' | |||
|
24 | 25 | else: |
|
25 | 26 | # On POSIX platforms, we can use a file descriptor to quit the event |
|
26 | 27 | # loop when there is input ready to read. |
|
27 |
notifier = QtCore.QSocketNotifier(context.fileno(), |
|
|
28 | notifier.setEnabled(True) | |
|
28 | notifier = QtCore.QSocketNotifier(context.fileno(), | |
|
29 | QtCore.QSocketNotifier.Read) | |
|
30 | # connect the callback we care about before we turn it on | |
|
29 | 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