MCPcopy Index your code
hub / github.com/ipython/ipython / _get_qt_vers

Function _get_qt_vers

tests/test_pt_inputhooks.py:12–26  ·  view source on GitHub ↗

If any version of Qt is available, this will populate `guis_avail` with 'qt' and 'qtx'. Due to the import mechanism, we can't import multiple versions of Qt in one session.

()

Source from the content-addressed store, hash-verified

10
11
12def _get_qt_vers():
13 """If any version of Qt is available, this will populate `guis_avail` with 'qt' and 'qtx'. Due
14 to the import mechanism, we can't import multiple versions of Qt in one session."""
15 for gui in ["qt", "qt6", "qt5"]:
16 print(f"Trying {gui}")
17 try:
18 set_qt_api(gui)
19 importlib.import_module("IPython.terminal.pt_inputhooks.qt")
20 guis_avail.append(gui)
21 if "QT_API" in os.environ.keys():
22 del os.environ["QT_API"]
23 except ImportError:
24 pass # that version of Qt isn't available.
25 except RuntimeError:
26 pass # the version of IPython doesn't know what to do with this Qt version.
27
28
29_get_qt_vers()

Callers 1

Calls 2

set_qt_apiFunction · 0.90
keysMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…