()
| 64 | |
| 65 | |
| 66 | def _setup_pyqt5plus(): |
| 67 | global QtCore, QtGui, QtWidgets, QtSvg, __version__ |
| 68 | global _isdeleted, _to_int |
| 69 | |
| 70 | if QT_API == QT_API_PYQT6: |
| 71 | from PyQt6 import QtCore, QtGui, QtWidgets, sip, QtSvg |
| 72 | __version__ = QtCore.PYQT_VERSION_STR |
| 73 | QtCore.Signal = QtCore.pyqtSignal |
| 74 | QtCore.Slot = QtCore.pyqtSlot |
| 75 | QtCore.Property = QtCore.pyqtProperty |
| 76 | _isdeleted = sip.isdeleted |
| 77 | _to_int = operator.attrgetter('value') |
| 78 | elif QT_API == QT_API_PYSIDE6: |
| 79 | from PySide6 import QtCore, QtGui, QtWidgets, QtSvg, __version__ |
| 80 | import shiboken6 |
| 81 | def _isdeleted(obj): return not shiboken6.isValid(obj) |
| 82 | if parse_version(__version__) >= parse_version('6.4'): |
| 83 | _to_int = operator.attrgetter('value') |
| 84 | else: |
| 85 | _to_int = int |
| 86 | elif QT_API == QT_API_PYQT5: |
| 87 | from PyQt5 import QtCore, QtGui, QtWidgets, QtSvg |
| 88 | import sip |
| 89 | __version__ = QtCore.PYQT_VERSION_STR |
| 90 | QtCore.Signal = QtCore.pyqtSignal |
| 91 | QtCore.Slot = QtCore.pyqtSlot |
| 92 | QtCore.Property = QtCore.pyqtProperty |
| 93 | _isdeleted = sip.isdeleted |
| 94 | _to_int = int |
| 95 | elif QT_API == QT_API_PYSIDE2: |
| 96 | from PySide2 import QtCore, QtGui, QtWidgets, QtSvg, __version__ |
| 97 | try: |
| 98 | from PySide2 import shiboken2 |
| 99 | except ImportError: |
| 100 | import shiboken2 |
| 101 | def _isdeleted(obj): |
| 102 | return not shiboken2.isValid(obj) |
| 103 | _to_int = int |
| 104 | else: |
| 105 | raise AssertionError(f"Unexpected QT_API: {QT_API}") |
| 106 | |
| 107 | |
| 108 | if QT_API in [QT_API_PYQT6, QT_API_PYQT5, QT_API_PYSIDE6, QT_API_PYSIDE2]: |
no outgoing calls
no test coverage detected
searching dependent graphs…