More pyqt6 enum goodness

This commit is contained in:
Kovid Goyal 2022-06-23 11:14:35 +05:30
parent e415463168
commit 9a6cb80fe4
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -644,7 +644,7 @@ class WordsModel(QAbstractTableModel):
except IndexError:
pass
elif role == Qt.ItemDataRole.InitialSortOrderRole:
return Qt.SortOrder.DescendingOrder if section == 1 else Qt.SortOrder.AscendingOrder
return (Qt.SortOrder.DescendingOrder if section == 1 else Qt.SortOrder.AscendingOrder).value # https://bugreports.qt.io/browse/PYSIDE-1974
elif role == Qt.ItemDataRole.TextAlignmentRole:
return int(Qt.AlignmentFlag.AlignVCenter | self.alignments[section]) # https://bugreports.qt.io/browse/PYSIDE-1974