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