code: def flags(self, index):
          
          flags = super(DataFrameModel, self).flags(index)
  
          if not self.editable:
              return flags
  
          col = self._dataFrame.columns[index.column()]
          if self._dataFrame[col].dtype == numpy.bool:
              flags |= Qt.ItemIsUserCheckable
          else:
              # if you want to have a combobox for bool columns set this
              flags |= Qt.ItemIsEditable
  
          return flags
docs: Returns the item flags for the given index as ored value, e.x.: Qt.ItemIsUserCheckable | Qt.ItemIsEditable
  
          If a combobox for bool values should pop up ItemIsEditable have to set for bool columns too.
  
          Args:
              index (QtCore.QModelIndex): Index to define column and row
  
          Returns:
              if column dtype is not boolean Qt.ItemIsSelectable | Qt.ItemIsEnabled | Qt.ItemIsEditable
              if column dtype is boolean Qt.ItemIsSelectable | Qt.ItemIsEnabled | Qt.ItemIsUserCheckable