code: def eventFilter(self, watchedObject, event):
          
          if event.type() == QtCore.QEvent.KeyPress:
              key = event.key()
              if key in (Qt.Key_Tab, Qt.Key_Backtab):
                  self.commitAndClose()
                  return True
              else:
                  return False
  
          return super(AbstractCtiEditor, self).eventFilter(watchedObject, event)
docs: Calls commitAndClose when the tab and back-tab are pressed.
              This is necessary because, normally the event filter of QStyledItemDelegate does this
              for us. However, that event filter works on this object, not on the sub editor.