filter
filter
Attributes
Classes
FilterProxy(parent=None)
Bases: QSortFilterProxyModel
Filters the tree by key text and hides binary blobs.
Hidden values stay in the source model, so they are preserved on save.
Initialize the proxy.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
parent
|
QObject | None
|
Parent object. |
None
|
Source code in src/json_config_qt/tree/filter.py
13 14 15 16 17 18 19 20 21 22 | |
Methods:
filterAcceptsRow(source_row, source_parent)
Return whether a row is visible.
Binary rows are always hidden; other rows are shown if their key, a descendant's key or an ancestor's key matches the filter.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
source_row
|
int
|
Row in the source model. |
required |
source_parent
|
QModelIndex
|
Parent index in the source model. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
bool |
bool
|
True if the row is shown. |
Source code in src/json_config_qt/tree/filter.py
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 | |
set_filter_text(text)
Show only keys containing text (case-insensitive) and their subtrees.
Source code in src/json_config_qt/tree/filter.py
24 25 26 | |