code: def flags(self, index):
          
  
          if not index.isValid():
              return QtCore.Qt.NoItemFlags
  
          item = index.internalPointer()
  
          # return QtCore.Qt.ItemIsEnabled | QtCore.Qt.ItemIsSelectable |
          # QtCore.Qt.ItemIsDragEnabled
          return item.getFlags()
docs: Returns the item flags for the given index.