mirror of
https://github.com/spalencsar/bearhub.git
synced 2026-07-07 01:14:15 +02:00
improvements
This commit is contained in:
@@ -132,12 +132,23 @@ class InputFilter(QLineEdit):
|
||||
def __init__(self, on_key_press):
|
||||
super(InputFilter, self).__init__()
|
||||
self.on_key_press = on_key_press
|
||||
self.last_text = ''
|
||||
|
||||
def keyPressEvent(self, event):
|
||||
super(InputFilter, self).keyPressEvent(event)
|
||||
if event.key() != Qt.EnterKeyReturn:
|
||||
text = self.text().strip()
|
||||
|
||||
if text != self.last_text:
|
||||
self.last_text = text
|
||||
self.on_key_press()
|
||||
|
||||
def get_text(self):
|
||||
return self.last_text
|
||||
|
||||
def setText(self, p_str):
|
||||
super(InputFilter, self).setText(p_str)
|
||||
self.last_text = p_str
|
||||
|
||||
|
||||
def new_single_select(model: SingleSelectComponent):
|
||||
if model.type == SelectViewType.RADIO:
|
||||
|
||||
Reference in New Issue
Block a user