Return which API is loaded, if any If this returns anything besides None, importing any other Qt binding is unsafe. Returns ------- None, 'pyside2', 'pyside', 'pyqt', 'pyqt5', or 'pyqtv1'
()
| 83 | |
| 84 | |
| 85 | def loaded_api(): |
| 86 | """Return which API is loaded, if any |
| 87 | |
| 88 | If this returns anything besides None, |
| 89 | importing any other Qt binding is unsafe. |
| 90 | |
| 91 | Returns |
| 92 | ------- |
| 93 | None, 'pyside2', 'pyside', 'pyqt', 'pyqt5', or 'pyqtv1' |
| 94 | """ |
| 95 | if 'PyQt4.QtCore' in sys.modules: |
| 96 | if qtapi_version() == 2: |
| 97 | return QT_API_PYQT |
| 98 | else: |
| 99 | return QT_API_PYQTv1 |
| 100 | elif 'PySide.QtCore' in sys.modules: |
| 101 | return QT_API_PYSIDE |
| 102 | elif 'PySide2.QtCore' in sys.modules: |
| 103 | return QT_API_PYSIDE2 |
| 104 | elif 'PyQt5.QtCore' in sys.modules: |
| 105 | return QT_API_PYQT5 |
| 106 | return None |
| 107 | |
| 108 | |
| 109 | def has_binding(api): |
no test coverage detected