spinetoolbox.mvcmodels.resource_filter_model
Contains ResourceFilterModel.
Module Contents
Classes
|
- class spinetoolbox.mvcmodels.resource_filter_model.ResourceFilterModel(connection, project, undo_stack, logger)[source]
Bases:
PySide6.QtGui.QStandardItemModel
- Parameters
connection (LoggingConnection) – connection whose resources to model
project (SpineToolboxProject) – project
undo_stack (QUndoStack) – an undo stack
logger (LoggerInterface) – a logger
- _change_filter_checked_state(index, is_on)[source]
Changes the online status of the filter item at index.
- Parameters
index (QModelIndex) – item’s index
is_on (bool) – True if filter are turned online, False otherwise
- set_online(resource, filter_type, online)[source]
Sets the given filters online or offline.
- Parameters
resource (str) – Resource label
filter_type (str) – Always SCENARIO_FILTER_TYPE, for now.
online (dict) – mapping from scenario/tool id to online flag
- _find_filter_type_item(resource, filter_type)[source]
Searches for filter type item.
- Parameters
resource (str) – resource label
filter_type (str) – filter type identifier
- Returns
filter type item or None if not found
- Return type
QStandardItem
- filter_type_items(filter_type)[source]
An iterator to filter type items.
- Parameters
filter_type (str) – filter type
- Yields
QStandardItem – filter type item
- _set_all_selected_item(resource, filter_type_item, emit_data_changed=False)[source]
Updates ‘Select All’ item’s checked state.
- Parameters
resource (str) – resource label
filter_type_item (QStandardItem) – filter type item
emit_data_changed (bool) – if True, emit dataChanged signal if the state was updated