If you do something like this redefining QAbstractItemModel.data():
def data(self, index, role):
if role == TextAlignmentRole:
return AlignBottom # it works
return AlignRight # it also works
return AlignBottom|AlignRight # it doesn't work
# you must do this:
return int(AlignBottom|AlignRight) # it now works
I think it's due to the fact that:
print AlignBottom|AlignRight
#: <Alignment object at 0x7f7c70093210>
Since AlignBottom|AlignRight generates an Alignment object, it's not well digested as a return type for QAbstractItemModel.data(index, TextAlignmentRole).
Until this issue is fixed, a simple cast to int will bypass this bug.
If you do something like this redefining QAbstractItemModel.data():
I think it's due to the fact that:
Since AlignBottom|AlignRight generates an Alignment object, it's not well digested as a return type for QAbstractItemModel.data(index, TextAlignmentRole).
Until this issue is fixed, a simple cast to int will bypass this bug.