Return a list of acceptable QT APIs, in decreasing order of preference
()
| 105 | |
| 106 | |
| 107 | def get_options(): |
| 108 | """Return a list of acceptable QT APIs, in decreasing order of |
| 109 | preference |
| 110 | """ |
| 111 | # already imported Qt somewhere. Use that |
| 112 | loaded = loaded_api() |
| 113 | if loaded is not None: |
| 114 | return [loaded] |
| 115 | |
| 116 | mpl = sys.modules.get("matplotlib", None) |
| 117 | |
| 118 | if mpl is not None and not check_version(mpl.__version__, "1.0.2"): |
| 119 | # 1.0.1 only supports PyQt4 v1 |
| 120 | return [QT_API_PYQT_DEFAULT] |
| 121 | |
| 122 | if os.environ.get("QT_API", None) is None: |
| 123 | # no ETS variable. Ask mpl, then use either |
| 124 | return matplotlib_options(mpl) or [QT_API_PYQT_DEFAULT, QT_API_PYSIDE, QT_API_PYSIDE2, QT_API_PYQT5, QT_API_PYQT6] |
| 125 | |
| 126 | # ETS variable present. Will fallback to external.qt |
| 127 | return None |
| 128 | |
| 129 | |
| 130 | api_opts = get_options() |
no test coverage detected