def METHOD_NAME(self, index, value, role):
    if not index.isValid() or role != Qt.EditRole or index.column() != 1:
        return False
    node = index.internalPointer()
    ref = node.ref
    ref.state = value
    return True