def focusOutEvent(self, evt): QLineEdit.focusOutEvent(self, evt) self.lostFocus.emit() self.completer.popup().hide()