code: def removeSubEditor(self, subEditor):
          
          if subEditor is self.focusProxy():
              self.setFocusProxy(None)
  
          subEditor.removeEventFilter(self)
          self._subEditors.remove(subEditor)
          self.hBoxLayout.removeWidget(subEditor)
docs: Removes the subEditor from the layout and removes the event filter.