QSearchableListWidget¶
A QListWidget with a text field
above it. Typing in the field hides the items that don't contain the text
(ignoring case).
QSearchableListWidget is a QWidget that contains a QListWidget
(list_widget) and a QLineEdit (filter_widget), and forwards the methods of
QListWidget to the list, so it can be used like one. The difference is that it
isn't a QListWidget: it can't be passed as the parent of a QListWidgetItem
(use list_widget instead), and isinstance checks for QListWidget fail.
from qtpy.QtWidgets import QApplication
from superqt import QSearchableListWidget
app = QApplication([])
widget = QSearchableListWidget()
widget.addItems(["foo", "bar", "baz", "foobar", "foobaz", "barbaz"])
widget.show()
app.exec()
Subclass of QWidget
QSearchableListWidget inherits all of QWidget's methods, signals, and properties. Only those that superqt adds or changes are listed here.