pyqt_reactive.widgets.shared.abstract_table_browser
Abstract base class for table-based browser widgets.
Provides common infrastructure for widgets that display searchable, filterable table views of item collections. Subclasses implement the abstract methods to customize column layout, row population, and event handling.
Classes
|
Abstract base class for table-based browser widgets. |
|
Declarative column configuration for table browsers. |
- class pyqt_reactive.widgets.shared.abstract_table_browser.ColumnDef(name: str, key: str, width: int | None = None, sortable: bool = True, resizable: bool = True)[source]
Declarative column configuration for table browsers.
- class pyqt_reactive.widgets.shared.abstract_table_browser.AbstractTableBrowser(color_scheme: ColorScheme | None = None, selection_mode: Literal['single', 'multi'] = 'single', parent=None)[source]
Abstract base class for table-based browser widgets.
Provides: - Table widget with configurable columns (static or dynamic) - Search input with SearchService integration - Status label showing item counts - Row selection handling (single or multi-select)
Subclasses must implement abstract methods to customize behavior.
- item_selected
int = …, arguments: Sequence = …) -> PYQT_SIGNAL
types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.
- Type:
pyqtSignal(*types, name
- Type:
str = …, revision
- item_double_clicked
int = …, arguments: Sequence = …) -> PYQT_SIGNAL
types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.
- Type:
pyqtSignal(*types, name
- Type:
str = …, revision
- items_selected
int = …, arguments: Sequence = …) -> PYQT_SIGNAL
types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.
- Type:
pyqtSignal(*types, name
- Type:
str = …, revision
- INCREMENTAL_POPULATE_THRESHOLD = 750
- INCREMENTAL_BATCH_SIZE = 200
- __init__(color_scheme: ColorScheme | None = None, selection_mode: Literal['single', 'multi'] = 'single', parent=None)[source]
- reconfigure_columns()[source]
Reconfigure table columns. Call when get_columns() returns different values.
- get_selected_keys() → List[str][source]
Return list of selected item keys. Works for both single and multi-select.
- set_filtered_items(filtered_items: Dict[str, T])[source]
Update filtered items without recreating SearchService.
Use this when all_items hasn’t changed, only filter criteria changed. Much faster than set_items() for checkbox filter updates.
- populate_table_incremental(items: Dict[str, T], *, token: int, batch_size: int = 200) → None[source]
Populate table in batches to avoid blocking the UI.
- abstractmethod extract_row_data(item: T) → List[str][source]
Extract display values for a table row from an item.
- on_item_selected(key: str, item: T)[source]
Called when an item is selected (single-select mode). Override to handle.