pyqt_reactive.widgets.shared.manager_item_hooks

Typed list-item hook declarations for manager widgets.

Classes

AttributeItemIdProjection(path)

Project an item id from an object attribute path.

DictItemIdProjection(key)

Project an item id from a mapping key.

ItemIdProjection()

Projects a stable selection id from a manager backing item.

ListItemDataProjection(project, resolve_data)

Bidirectional codec for QListWidgetItem.UserRole payloads.

ManagerItemHooks(id_projection, ...)

Typed source for list-item behavior consumed by AbstractManagerWidget.

class pyqt_reactive.widgets.shared.manager_item_hooks.ItemIdProjection[source]

Projects a stable selection id from a manager backing item.

class pyqt_reactive.widgets.shared.manager_item_hooks.DictItemIdProjection(key: str)[source]

Project an item id from a mapping key.

key: str
__init__(key: str) None
class pyqt_reactive.widgets.shared.manager_item_hooks.AttributeItemIdProjection(path: str)[source]

Project an item id from an object attribute path.

path: str
__init__(path: str) None
class pyqt_reactive.widgets.shared.manager_item_hooks.ListItemDataProjection(project: Callable[[Any, int], Any], resolve_data: Callable[[Any, list[Any]], Any])[source]

Bidirectional codec for QListWidgetItem.UserRole payloads.

project: Callable[[Any, int], Any]
resolve_data: Callable[[Any, list[Any]], Any]
resolve(data: Any, items: list[Any]) Any[source]
__init__(project: Callable[[Any, int], Any], resolve_data: Callable[[Any, list[Any]], Any]) None
class pyqt_reactive.widgets.shared.manager_item_hooks.ManagerItemHooks(id_projection: ~pyqt_reactive.widgets.shared.manager_item_hooks.ItemIdProjection = <factory>, preserve_selection_pred: ~collections.abc.Callable[[~typing.Any], bool] = <function ManagerItemHooks.<lambda>>, data_projection: ~pyqt_reactive.widgets.shared.manager_item_hooks.ListItemDataProjection = <factory>)[source]

Typed source for list-item behavior consumed by AbstractManagerWidget.

id_projection: ItemIdProjection
preserve_selection_pred: Callable[[Any], bool]
data_projection: ListItemDataProjection
item_id(item: Any) str[source]
should_preserve_selection(manager: Any) bool[source]
list_item_data_for(item: Any, index: int) Any[source]
item_from_list_data(data: Any, items: list[Any]) Any[source]
__init__(id_projection: ~pyqt_reactive.widgets.shared.manager_item_hooks.ItemIdProjection = <factory>, preserve_selection_pred: ~collections.abc.Callable[[~typing.Any], bool] = <function ManagerItemHooks.<lambda>>, data_projection: ~pyqt_reactive.widgets.shared.manager_item_hooks.ListItemDataProjection = <factory>) None