code: def setItemData(self, treeItem, column, value, role=Qt.EditRole):
          
          if role == Qt.CheckStateRole:
              if column != self.COL_VALUE:
                  return False
              else:
                  logger.debug("Setting check state (col={}): {!r}".format(column, value))
                  treeItem.checkState = value
                  return True
  
          elif role == Qt.EditRole:
              if column != self.COL_VALUE:
                  return False
              else:
                  logger.debug("Set Edit value (col={}): {!r}".format(column, value))
                  treeItem.data = value
                  return True
          else:
              raise ValueError("Unexpected edit role: {}".format(role))
docs: Sets the role data for the item at index to value.