'Overriding method commitAndCloseEditor'

def commitAndCloseEditor(self):

    editor = self.sender()
    try:
        self.commitData.emit(editor)
    except AttributeError:
        pass
    self.closeEditor.emit(editor, QAbstractItemDelegate.NoHint)
