Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

QAbstractItemModel.data(index, TextAlignmentRole) alignment flag combo ignored #140

Open
Oni opened this issue Jan 30, 2016 · 0 comments
Open

Comments

@Oni
Copy link

Oni commented Jan 30, 2016

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant