Show More
@@ -95,6 +95,7 b' def matplotlib_options(mpl):' | |||||
95 | mpqt) |
|
95 | mpqt) | |
96 |
|
96 | |||
97 | def get_options(): |
|
97 | def get_options(): | |
|
98 | print(f'`get_options` called with {os.environ.get("QT_API", None)=}') | |||
98 | """Return a list of acceptable QT APIs, in decreasing order of preference.""" |
|
99 | """Return a list of acceptable QT APIs, in decreasing order of preference.""" | |
99 | #already imported Qt somewhere. Use that |
|
100 | #already imported Qt somewhere. Use that | |
100 | loaded = loaded_api() |
|
101 | loaded = loaded_api() | |
@@ -129,5 +130,7 b' def get_options():' | |||||
129 |
|
130 | |||
130 |
|
131 | |||
131 | api_opts = get_options() |
|
132 | api_opts = get_options() | |
|
133 | print(f'Importing `IPython.terminal.pt_inputhooks.qt` with {api_opts=}') | |||
132 | QtCore, QtGui, QtSvg, QT_API = load_qt(api_opts) |
|
134 | QtCore, QtGui, QtSvg, QT_API = load_qt(api_opts) | |
|
135 | print(f'Loaded Qt with {QT_API=}') | |||
133 | enum_helper = enum_factory(QT_API, QtCore) |
|
136 | enum_helper = enum_factory(QT_API, QtCore) |
@@ -711,6 +711,7 b' class TerminalInteractiveShell(InteractiveShell):' | |||||
711 |
|
711 | |||
712 | active_eventloop = None |
|
712 | active_eventloop = None | |
713 | def enable_gui(self, gui=None): |
|
713 | def enable_gui(self, gui=None): | |
|
714 | print(f'Someone called `enable_gui` with {gui=}.') | |||
714 | if gui and (gui not in {"inline", "webagg"}): |
|
715 | if gui and (gui not in {"inline", "webagg"}): | |
715 | # This hook runs with each cycle of the `prompt_toolkit`'s event loop. |
|
716 | # This hook runs with each cycle of the `prompt_toolkit`'s event loop. | |
716 | self.active_eventloop, self._inputhook = get_inputhook_name_and_func(gui) |
|
717 | self.active_eventloop, self._inputhook = get_inputhook_name_and_func(gui) |
@@ -41,6 +41,7 b' class UnknownBackend(KeyError):' | |||||
41 |
|
41 | |||
42 |
|
42 | |||
43 | def get_inputhook_name_and_func(gui): |
|
43 | def get_inputhook_name_and_func(gui): | |
|
44 | print(f'`get_inputhook_name_and_func` called with {gui=}') | |||
44 | if gui in registered: |
|
45 | if gui in registered: | |
45 | return gui, registered[gui] |
|
46 | return gui, registered[gui] | |
46 |
|
47 |
@@ -57,7 +57,7 b' def inputhook(context):' | |||||
57 | QtCore.QTimer.singleShot(0, _reclaim_excepthook) |
|
57 | QtCore.QTimer.singleShot(0, _reclaim_excepthook) | |
58 |
|
58 | |||
59 | event_loop = QtCore.QEventLoop(app) |
|
59 | event_loop = QtCore.QEventLoop(app) | |
60 |
|
60 | print(f'`inputhook` running Qt {QtCore.qVersion()} event loop.\r') | ||
61 | if sys.platform == 'win32': |
|
61 | if sys.platform == 'win32': | |
62 | # The QSocketNotifier method doesn't appear to work on Windows. |
|
62 | # The QSocketNotifier method doesn't appear to work on Windows. | |
63 | # Use polling instead. |
|
63 | # Use polling instead. |
General Comments 0
You need to be logged in to leave comments.
Login now