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.
()
| 10 | |
| 11 | |
| 12 | def _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() |
no test coverage detected
searching dependent graphs…