def METHOD_NAME(self, parent, option, index):
    editor = SearchBarEditor(parent)
    editor.set_data(index.data(), index.data(Qt.ItemDataRole.UserRole))
    model = index.model()
    editor.data_committed.connect(lambda e=editor, i=index, m=model: self.close_editor(e, i, m))
    return editor