def METHOD_NAME(self, index: QModelIndex, value, role=None):
    if role == Qt.EditRole:
        i, j = index.row(), index.column()
        label = self.message_type[i]  # type: SimulatorProtocolLabel
        if j == 0:
            label.name = value
            ft = self.controller.field_types_by_caption.get(value, FieldType("Custom", FieldType.Function.CUSTOM))
            label.field_type = ft
        elif j == 1:
            label.display_format_index = value
        elif j == 2:
            label.value_type_index = value
        elif j == 3:
            if label.value_type_index == 0:
                message = label.parent()
                try:
                    bits = util.convert_string_to_bits(value, label.display_format_index,
                                                       target_num_bits=label.end-label.start)
                    message.plain_bits[label.start:label.end] = bits
                except ValueError:
                    pass
            elif label.value_type_index == 2:
                label.formula = value
            elif label.value_type_index == 3:
                label.external_program = value
            elif label.value_type_index == 4:
                label.random_min = value[0]
                label.random_max = value[1]
        self.dataChanged.emit(self.index(i, 0),
                              self.index(i, self.columnCount()))
        self.protocol_label_updated.emit(label)
    return True