def __init__(self, *args, **kwargs): EnComboBox.__init__(self, *args) self.setLineEdit(LineEdit(self, completer_widget=self, sort_func=kwargs.get('sort_func', sort_key))) self.lineEdit().item_selected.connect(self.item_selected) self.setCompleter(None) self.eat_focus_out = True self.installEventFilter(self)
def eventFilter(self, obj, e): try: c = self.lineEdit().mcompleter except AttributeError: return False etype = e.type() if self.eat_focus_out and self is obj and etype == e.FocusOut: if c.isVisible(): return True return EnComboBox.eventFilter(self, obj, e)
def clear(self): self.lineEdit().clear() EnComboBox.clear(self)
def __init__(self, *args): EnComboBox.__init__(self, *args) self.setLineEdit(LineEdit(self, completer_widget=self)) self.setCompleter(None) self.eat_focus_out = True self.installEventFilter(self)
def __init__(self, *args): EnComboBox.__init__(self, *args) self.le = MultiCompleteLineEdit(self, completer_widget=self) self.setLineEdit(self.le)
def __init__(self, *args, **kwargs): EnComboBox.__init__(self, *args) self.setLineEdit(LineEdit(self, completer_widget=self, sort_func=kwargs.get("sort_func", sort_key))) self.setCompleter(None) self.eat_focus_out = True self.installEventFilter(self)