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

AbstractTableBrowser([color_scheme, ...])

Abstract base class for table-based browser widgets.

ColumnDef(name, key[, width, sortable, ...])

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.

name: str
key: str
width: int | None = None
sortable: bool = True
resizable: bool = True
__init__(name: str, key: str, width: int | None = None, sortable: bool = True, resizable: bool = True) None
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]
all_items: Dict[str, T]
filtered_items: Dict[str, T]
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_items(items: Dict[str, T])[source]

Set items to display in the table.

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(items: Dict[str, T])[source]

Populate the table with the given items.

populate_table_incremental(items: Dict[str, T], *, token: int, batch_size: int = 200) None[source]

Populate table in batches to avoid blocking the UI.

refresh()[source]

Refresh the table display.

abstractmethod get_columns() List[ColumnDef][source]

Return column definitions for the table.

abstractmethod extract_row_data(item: T) List[str][source]

Extract display values for a table row from an item.

abstractmethod get_searchable_text(item: T) str[source]

Return searchable text for an item.

get_search_placeholder() str[source]

Return placeholder text for search input.

on_item_selected(key: str, item: T)[source]

Called when an item is selected (single-select mode). Override to handle.

on_items_selected(keys: List[str])[source]

Called when items are selected (multi-select mode). Override to handle.

on_item_double_clicked(key: str, item: T)[source]

Called when an item is double-clicked. Override to handle action.