-
Bug
-
Resolution: Unresolved
-
Not Evaluated
-
None
-
6.10.0
-
None
Almost all of the QMatrix element getters are implemented with __call__ and correctly type hinted.
QMatrix4x4 is implemented with __getitem__ and is not documented in the type hints.
I would expect this to be consistently implemented for all QMatrix classes.
from PySide6.QtGui import QMatrix3x3, QMatrix4x4 m33 = QMatrix3x3() e11 = m33(0, 0) m44 = QMatrix4x4() e11 = m44(0, 0) # TypeError: 'PySide6.QtGui.QMatrix4x4' object is not callable e11 = m44[0, 0] # This is not documented in the type hints
Either the following type hint needs to be added to QMatrix4x4 to document the real behaviour.
def __getitem__(self, item: tuple[int, int]) -> float: ...
Or __call__ should be implemented on QMatrix4x4 to match the other QMatrix classes and C++.
Personally I would prefer the latter for consistency.
__getitem__ should be kept but undocumented for backwards compatibilty.