spinetoolbox.spine_db_editor.widgets.custom_qtreeview
Classes for custom QTreeViews and QTreeWidgets.
Module Contents
Classes
Tree view for entity classes and entities. |
|
Base class for all non-entity tree views. |
|
Custom QTreeView for the alternative tree in SpineDBEditor. |
|
Custom QTreeView for the scenario tree in SpineDBEditor. |
|
Custom QTreeView class for parameter_value_list in SpineDBEditor. |
- class spinetoolbox.spine_db_editor.widgets.custom_qtreeview.EntityTreeView(parent)[source]
Bases:
spinetoolbox.widgets.custom_qtreeview.CopyPasteTreeView
Tree view for entity classes and entities.
- Parameters
parent (QWidget) – parent widget
- connect_spine_db_editor(spine_db_editor)[source]
Connects a Spine db editor to work with this view.
- Parameters
spine_db_editor (SpineDBEditor) –
Creates a context menu for this view.
- _handle_selection_changed(selected, deselected)[source]
Classifies selection by item type and emits signal.
- mousePressEvent(event)[source]
Overrides selection behaviour if the user has selected sticky selection in Settings. If sticky selection is enabled, multiple-selection is enabled when selecting items in the Object tree. Pressing the Ctrl-button down, enables single selection.
- Parameters
event (QMouseEvent) –
- update_actions_availability()[source]
Updates the visible property of actions according to whether or not they apply to given item.
- find_next_entity()[source]
Finds the next occurrence of the relationship at the current index and expands it.
- class spinetoolbox.spine_db_editor.widgets.custom_qtreeview.ItemTreeView(parent)[source]
Bases:
spinetoolbox.widgets.custom_qtreeview.CopyPasteTreeView
Base class for all non-entity tree views.
- Parameters
parent (QWidget) – parent widget
- abstract update_actions_availability(item)[source]
Updates the visible property of actions according to whether or not they apply to given item.
- connect_spine_db_editor(spine_db_editor)[source]
Prepares the view to work with the DB editor.
- Parameters
spine_db_editor (SpineDBEditor) – editor instance
Creates a context menu for this view.
- class spinetoolbox.spine_db_editor.widgets.custom_qtreeview.AlternativeTreeView(parent)[source]
Bases:
ItemTreeView
Custom QTreeView for the alternative tree in SpineDBEditor.
- Parameters
parent (QWidget) – parent widget
See base class.
- _db_map_alt_ids_from_selection(selection)[source]
Gather alternative ids per database map from selection.
- Parameters
selection (QItemSelection) – selection
- Returns
mapping from database map to set of alternative ids
- Return type
dict
- class spinetoolbox.spine_db_editor.widgets.custom_qtreeview.ScenarioTreeView(parent)[source]
Bases:
ItemTreeView
Custom QTreeView for the scenario tree in SpineDBEditor.
- Parameters
parent (QWidget) – parent widget
See base class.
- _db_map_alternative_ids_from_selection(selection)[source]
Collects database maps and alternative ids within given selection.
- Parameters
selection (Sequence of QModelIndex) – selection indices
- Returns
mapping from database map to set of alternative ids
- Return type
dict
- class spinetoolbox.spine_db_editor.widgets.custom_qtreeview.ParameterValueListTreeView(parent)[source]
Bases:
ItemTreeView
Custom QTreeView class for parameter_value_list in SpineDBEditor.
- Parameters
parent (QWidget) – parent widget
Creates a context menu for this view.