Details
Description
Qt.AlignmentFlag can't be used as argument to functions expecting Qt.Alignment since PySide6 6.2.2.
Using this code which was typed correctly on 6.2.1:
detailslayout = QHBoxLayout() detailslayout.setAlignment(Qt.AlignLeft)
is now reporting type violations:
error: No overload variant of "setAlignment" of "QLayout" matches argument type "AlignmentFlag"
Furthermore Qt.AlignmentFlag is not composable anymore:
Qt.AlignLeft | Qt.AlignVCenter
reports
error: Unsupported left operand type for | ("AlignmentFlag")
The relevant change in QtCore.pyb seems to be the move from Shiboken.Enum to Enum for class AlignmentFlag:
# 6.2.1 class AlignmentFlag(Shiboken.Enum): AlignLeading : Qt.AlignmentFlag = ... # 0x1 AlignLeft : Qt.AlignmentFlag = ... # 0x1 # 6.2.2 class AlignmentFlag(Enum): AlignLeading : Qt.AlignmentFlag = ... # 0x1 AlignLeft : Qt.AlignmentFlag = ... # 0x1
Attachments
Issue Links
- is required for
-
PYSIDE-1675 Improve mypy compatibility with our python stubs (pyi)
- Open
- relates to
-
PYSIDE-1520 Type Checking using mypy errors erroneously
- Closed
For Gerrit Dashboard: PYSIDE-1731 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
413060,3 | PyEnum: Fix the old Enums to produce correct .pyi files, again | dev | pyside/pyside-setup | Status: MERGED | +2 | 0 |
413308,2 | PyEnum: Fix the old Enums to produce correct .pyi files, again | 6.3 | pyside/pyside-setup | Status: MERGED | +2 | 0 |