File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11# compat.py
22from qgis .PyQt .QtCore import QVariant
33
4- if hasattr (QVariant , "Int" ):
5- # QGIS 3 / PyQt5: QVariant still exposes the legacy .Type enum members.
6- # (QMetaType is importable under PyQt5 too, so we can't use that import
7- # to detect QGIS 4 - checking for the attribute QGIS 4 actually removed
8- # is the only reliable signal.)
4+ if hasattr (QVariant , "Type" ):
5+ # QGIS 3 / PyQt5: QVariant still exposes the legacy .Type enum.
6+ # (QMetaType is importable under PyQt5 too, and PyQt6's QVariant still
7+ # keeps scalar constants like QVariant.Int for convenience, so neither
8+ # of those can be used to detect QGIS 4 - .Type is the attribute QGIS 4
9+ # actually removed, so it's the only reliable signal.)
910 QVariantCompat = QVariant
1011else :
1112 # QGIS 4 / PyQt6: QVariant.Type was removed; use QMetaType instead.
You can’t perform that action at this time.
0 commit comments