code: def flags(self, index):
          
          if not index.isValid():
              return 0
  
          cti = self.getItem(index)
  
          result = Qt.ItemIsSelectable
  
          if cti.enabled:
              result |= Qt.ItemIsEnabled
  
          if index.column() == self.COL_VALUE:
              result |= cti.valueColumnItemFlags
  
          return result
docs: Returns the item flags for the given index.