Workaround broken alignment flags in PyQt 6.3.1 (#1922)

Closes #1921
This commit is contained in:
RumovZ 2022-06-22 01:44:50 +02:00 committed by GitHub
parent 1b8bab73d1
commit cd3f9ff646
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -329,7 +329,7 @@ class DataModel(QAbstractTableModel):
align: Qt.AlignmentFlag | int = Qt.AlignmentFlag.AlignVCenter
if self.column_at(index).alignment == Columns.ALIGNMENT_CENTER:
align |= Qt.AlignmentFlag.AlignHCenter
return align
return getattr(align, "value", align)
elif role == Qt.ItemDataRole.DisplayRole:
return self.get_cell(index).text
elif role == Qt.ItemDataRole.ToolTipRole and self._want_tooltips: