##// END OF EJS Templates
Explictly return which Qt gui has been enabled.
Emilio Graff -
Show More
@@ -71,7 +71,7 b' def set_qt_api(gui):'
71 71 print(
72 72 f"Cannot switch Qt versions for this session; will use {qt_env2gui[loaded]}."
73 73 )
74 return
74 return qt_env2gui[loaded]
75 75
76 76 if qt_api is not None and gui != "qt":
77 77 if qt_env2gui[qt_api] != gui:
@@ -79,6 +79,7 b' def set_qt_api(gui):'
79 79 f'Request for "{gui}" will be ignored because `QT_API` '
80 80 f'environment variable is set to "{qt_api}"'
81 81 )
82 return qt_env2gui[qt_api]
82 83 else:
83 84 if gui == "qt5":
84 85 try:
@@ -110,7 +111,10 b' def set_qt_api(gui):'
110 111 del os.environ["QT_API"]
111 112 else:
112 113 print(f'Unrecognized Qt version: {gui}. Should be "qt5", "qt6", or "qt".')
113 return
114 return None
115 # Import it now so we can figure out which version it is.
116 from IPython.external.qt_for_kernel import QT_API
117 return qt_env2gui[QT_API]
114 118
115 119
116 120 def get_inputhook_name_and_func(gui):
@@ -125,7 +129,7 b' def get_inputhook_name_and_func(gui):'
125 129
126 130 gui_mod = gui
127 131 if gui.startswith("qt"):
128 set_qt_api(gui)
132 gui = set_qt_api(gui)
129 133 gui_mod = "qt"
130 134
131 135 mod = importlib.import_module("IPython.terminal.pt_inputhooks." + gui_mod)
General Comments 0
You need to be logged in to leave comments. Login now