code: def data(self, index, role=Qt.DisplayRole):
          
          if not index.isValid() or not 0 <= index.row() < len(self._rows):
              return to_qvariant()
          row = index.row()
          column = index.column()
  
          name, state = self.row(row)
  
          if role == Qt.DisplayRole or role == Qt.EditRole:
              if column == 0:
                  return to_qvariant(name)
          elif role == Qt.CheckStateRole:
              if column == 0:
                  if state:
                      return Qt.Checked
                  else:
                      return Qt.Unchecked
              if column == 1:
                  return to_qvariant(state)
          return to_qvariant()
docs: Override Qt method