[PySide] Value of QAbtractItemModel.flags()

Alexey Vihorev vihorev at gmail.com
Fri Jun 14 01:03:18 CEST 2013


I guess that is a stupid question, but I was never able to understand binary
operators.  And now I'm stuck with this:



class MyModel(QAbtractItemModel):


def flags(index):

      if index.isValid() and whatever:

return Qt.ItemIsEditable|Qt.ItemIsEnabled|Qt.ItemIsSelectable #that is one
problematic return value


Now I need to know, if an item at a given index is editable. I get the
return value from model.flags(index), but how can I know if

Qt.ItemIsEditable is actually in there somewhere, inside this
Qt.ItemIsEditable|Qt.ItemIsEnabled|QtItemIsSelectable value? Thanks!

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/pyside/attachments/20130614/a86da9fd/attachment.html>

More information about the PySide mailing list