def METHOD_NAME(self, widget, key):
    value = str(self.value(key))
    index = widget.findText(value)
    if index == -1:
        widget.setEditText(value)
    else:
        widget.setCurrentIndex(index)
    widget.currentIndexChanged.connect(
        partial(self._combobox_currentIndexChanged, widget, key))
    widget.editTextChanged.connect(
        partial(self._combobox_editTextChanged, widget, key))