Description
Reporting this separately from PYSIDE-1906 because this isn't just an unexposed Qt thing, but something that seems unintended.
Individual PySide enum members are hashable:
>>> hash(Qt.Key_A) 65
and so are individual flags:
>>> hash(Qt.ControlModifier) 67108864 >>> type(Qt.ControlModifier) <class 'PySide6.QtCore.Qt.KeyboardModifier'> >>> type(Qt.ControlModifier).__mro__ (<class 'PySide6.QtCore.Qt.KeyboardModifier'>, <class 'Shiboken.Enum'>, <class 'object'>)
but as soon as flags get combined, they are unhashable:
>>> hash(Qt.ControlModifier | Qt.ShiftModifier) Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: unhashable type: 'PySide6.QtCore.Qt.KeyboardModifiers' >>> type(Qt.ControlModifier | Qt.ShiftModifier) <class 'PySide6.QtCore.Qt.KeyboardModifiers'> >>> type(Qt.ControlModifier | Qt.ShiftModifier).__mro__ (<class 'PySide6.QtCore.Qt.KeyboardModifiers'>, <class 'object'>)
despite still being an unique int, i.e., trivially hashable:
>>> int(Qt.ControlModifier | Qt.ShiftModifier)
100663296