Import PyQt5 ImportErrors rasied within this function are non-recoverable
()
| 212 | |
| 213 | |
| 214 | def import_pyqt5(): |
| 215 | """ |
| 216 | Import PyQt5 |
| 217 | |
| 218 | ImportErrors rasied within this function are non-recoverable |
| 219 | """ |
| 220 | |
| 221 | from PyQt5 import QtCore, QtSvg, QtWidgets, QtGui |
| 222 | |
| 223 | # Alias PyQt-specific functions for PySide compatibility. |
| 224 | QtCore.Signal = QtCore.pyqtSignal |
| 225 | QtCore.Slot = QtCore.pyqtSlot |
| 226 | |
| 227 | # Join QtGui and QtWidgets for Qt4 compatibility. |
| 228 | QtGuiCompat = types.ModuleType('QtGuiCompat') |
| 229 | QtGuiCompat.__dict__.update(QtGui.__dict__) |
| 230 | QtGuiCompat.__dict__.update(QtWidgets.__dict__) |
| 231 | |
| 232 | api = QT_API_PYQT5 |
| 233 | return QtCore, QtGuiCompat, QtSvg, api |
| 234 | |
| 235 | |
| 236 | def import_pyside(): |