code: def closeEditor(self, editor, hint):
          
          # It would be nicer if this method was part of ConfigItemDelegate since createEditor also
          # lives there. However, QAbstractItemView.closeEditor is sometimes called directly,
          # without the QAbstractItemDelegate.closeEditor signal begin emitted, e.g when the
          # currentItem changes. Therefore we cannot connect the QAbstractItemDelegate.closeEditor
          # signal to a slot in the ConfigItemDelegate.
          configItemDelegate = self.itemDelegate()
          configItemDelegate.finalizeEditor(editor)
  
          super(ConfigTreeView, self).closeEditor(editor, hint)
docs: Finalizes, closes and releases the given editor.