mirror of
https://github.com/spalencsar/bearhub.git
synced 2026-07-07 20:54:15 +02:00
filter by app name
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
from PyQt5.QtCore import QEvent, Qt
|
||||
from PyQt5.QtWidgets import QRadioButton, QGroupBox, QCheckBox, QComboBox, QGridLayout, QWidget, \
|
||||
QLabel, QSizePolicy
|
||||
QLabel, QSizePolicy, QLineEdit
|
||||
from bauh_api.abstract.view import SingleSelectComponent, InputOption, MultipleSelectComponent, SelectViewType
|
||||
|
||||
|
||||
@@ -126,6 +127,18 @@ class MultipleSelectQt(QGroupBox):
|
||||
col += 1
|
||||
|
||||
|
||||
class InputFilter(QLineEdit):
|
||||
|
||||
def __init__(self, on_key_press):
|
||||
super(InputFilter, self).__init__()
|
||||
self.on_key_press = on_key_press
|
||||
|
||||
def keyPressEvent(self, event):
|
||||
super(InputFilter, self).keyPressEvent(event)
|
||||
if event.key() != Qt.EnterKeyReturn:
|
||||
self.on_key_press(self.text())
|
||||
|
||||
|
||||
def new_single_select(model: SingleSelectComponent):
|
||||
if model.type == SelectViewType.RADIO:
|
||||
return RadioSelectQt(model)
|
||||
|
||||
Reference in New Issue
Block a user