def eventFilter(self, obj, event):
        """ Reimplemented to handle keyboard input and to auto-hide when the
            text edit loses focus.
        """
        if obj == self._text_edit:
            etype = event.type()

            if etype in( QtCore.QEvent.KeyPress, QtCore.QEvent.FocusOut ):
                self.cancel_completion()

        return super().eventFilter(obj, event)
 Reimplemented to handle keyboard input and to auto-hide when the
            text edit loses focus.
        
angrmanagement/vendor/qtconsole/completion_plain.py