code: def setData(self, index, value, role=QtCore.Qt.UserRole):
          
          if role == QtCore.Qt.EditRole:
              if isinstance(value, QtCore.QVariant):
                  value = value.toPyObject()
              elif isinstance(value, QtCore.QString):
                  value = str(value)
              self.model.setVerifiedValue(index.row(), self._headers[index.column()], value)
              self.countChanged.emit()
          elif role == QtCore.Qt.UserRole:
              row = index.row()
              if row == -1:
                  row = self.rowCount() -1
              self.model.overwriteParam(row, value)
          return True
docs: Sets data at *index* to *value* in underlying data structure
  
          See :qtdoc:`QAbstractItemModel<QAbstractItemModel.setData>`, 
          and :qtdoc:`subclassing<qabstractitemmodel.subclassing>`