spinetoolbox.spine_db_editor.widgets.custom_delegates
Custom item delegates.
Module Contents
Classes
A mixin that fixes Pivot table's header table editor position. |
|
A mixin that fixes Pivot table's header table editor position. |
|
A mixin that fixes Pivot table's header table editor position. |
|
A mixin that fixes Pivot table's header table editor position. |
|
Delegate for Array and Map editors' table cells. |
|
Base class for all custom stacked table delegates. |
|
A delegate for the database name. |
|
A delegate for either the value or the default value. |
|
A delegate for the default value. |
|
A delegate for the parameter_value. |
|
A delegate for the parameter value list. |
|
A delegate for the object_class name. |
|
A delegate for the object parameter name. |
|
A delegate for the entity byname. |
|
A delegate for the alternative name. |
|
Base class for all custom stacked table delegates. |
|
A delegate for the alternative tree. |
|
A delegate for the scenario tree. |
|
A delegate for the parameter_name and description columns in Parameter Definition Table View. |
|
A delegate for the parameter value list tree. |
|
A custom delegate for the model in {Add/Edit}ItemDialogs. |
|
A delegate for the model and view in {Add/Edit}EntityClassesDialog. |
|
A delegate for the model and view in {Add/Edit}EntitiesDialog. |
|
A delegate for the model and view in RemoveEntitiesDialog. |
|
A delegate for the name and value columns in Metadata Table View. |
|
A delegate for name and value columns in item metadata editor. |
- class spinetoolbox.spine_db_editor.widgets.custom_delegates.PivotTableDelegateMixin[source]
A mixin that fixes Pivot table’s header table editor position.
- class spinetoolbox.spine_db_editor.widgets.custom_delegates.RelationshipPivotTableDelegate(parent)[source]
Bases:
PivotTableDelegateMixin
,spinetoolbox.widgets.custom_delegates.CheckBoxDelegate
A mixin that fixes Pivot table’s header table editor position.
- Parameters
parent (SpineDBEditor) – parent widget, i.e. the database editor
- static _is_relationship_index(index)[source]
Checks whether the given index corresponds to a relationship, in which case we need to use the check box delegate.
- Parameters
index (QModelIndex) – index to check
- Returns
True if index corresponds to relationship, False otherwise
- Return type
bool
- setEditorData(editor, index)[source]
Do nothing. We’re setting editor data right away in createEditor.
- class spinetoolbox.spine_db_editor.widgets.custom_delegates.ScenarioAlternativeTableDelegate(parent)[source]
Bases:
PivotTableDelegateMixin
,spinetoolbox.widgets.custom_delegates.RankDelegate
A mixin that fixes Pivot table’s header table editor position.
- Parameters
parent (SpineDBEditor) – database editor
- static _is_scenario_alternative_index(index)[source]
Checks whether or not the given index corresponds to a scenario alternative, in which case we need to use the rank delegate.
- Returns
bool
- setEditorData(editor, index)[source]
Do nothing. We’re setting editor data right away in createEditor.
- class spinetoolbox.spine_db_editor.widgets.custom_delegates.ParameterPivotTableDelegate(parent)[source]
Bases:
PivotTableDelegateMixin
,PySide6.QtWidgets.QStyledItemDelegate
A mixin that fixes Pivot table’s header table editor position.
- Parameters
parent (SpineDBEditor) – parent widget, i.e. database editor
- class spinetoolbox.spine_db_editor.widgets.custom_delegates.ParameterValueElementDelegate[source]
Bases:
PySide6.QtWidgets.QStyledItemDelegate
Delegate for Array and Map editors’ table cells.
- value_editor_requested[source]
Emitted when editing the value requires the full blown editor dialog.
- setModelData(editor, model, index)[source]
Sets data in the model.
editor (CustomLineEditor): editor widget model (QAbstractItemModel): model index (QModelIndex): target index
- class spinetoolbox.spine_db_editor.widgets.custom_delegates.TableDelegate(parent, db_mngr)[source]
Bases:
PySide6.QtWidgets.QStyledItemDelegate
Base class for all custom stacked table delegates.
- db_mngr
database manager
- Type
- Parameters
parent (QWidget) – parent widget
db_mngr (SpineDBManager) – database manager
- class spinetoolbox.spine_db_editor.widgets.custom_delegates.DatabaseNameDelegate(parent, db_mngr)[source]
Bases:
TableDelegate
A delegate for the database name.
- Parameters
parent (QWidget) – parent widget
db_mngr (SpineDBManager) – database manager
- class spinetoolbox.spine_db_editor.widgets.custom_delegates.ParameterValueOrDefaultValueDelegate(parent, db_mngr)[source]
Bases:
TableDelegate
A delegate for either the value or the default value.
- Parameters
parent (QWidget) – parent widget
db_mngr (SpineDatabaseManager) – database manager
- _create_or_request_parameter_value_editor(parent, index)[source]
Emits the signal to request a standalone ParameterValueEditor from parent widget.
- Parameters
parent (QWidget) – editor’s parent widget
index (QModelIndex) – index to parameter value model
- Returns
editor or None if
parameter_value_editor_request
signal was emitted- Return type
- class spinetoolbox.spine_db_editor.widgets.custom_delegates.ParameterDefaultValueDelegate(parent, db_mngr)[source]
Bases:
ParameterValueOrDefaultValueDelegate
A delegate for the default value.
- Parameters
parent (QWidget) – parent widget
db_mngr (SpineDatabaseManager) – database manager
- class spinetoolbox.spine_db_editor.widgets.custom_delegates.ParameterValueDelegate(parent, db_mngr)[source]
Bases:
ParameterValueOrDefaultValueDelegate
A delegate for the parameter_value.
- Parameters
parent (QWidget) – parent widget
db_mngr (SpineDatabaseManager) – database manager
- class spinetoolbox.spine_db_editor.widgets.custom_delegates.ValueListDelegate(parent, db_mngr)[source]
Bases:
TableDelegate
A delegate for the parameter value list.
- Parameters
parent (QWidget) – parent widget
db_mngr (SpineDBManager) – database manager
- class spinetoolbox.spine_db_editor.widgets.custom_delegates.EntityClassNameDelegate(parent, db_mngr)[source]
Bases:
TableDelegate
A delegate for the object_class name.
- Parameters
parent (QWidget) – parent widget
db_mngr (SpineDBManager) – database manager
- class spinetoolbox.spine_db_editor.widgets.custom_delegates.ParameterNameDelegate(parent, db_mngr)[source]
Bases:
TableDelegate
A delegate for the object parameter name.
- Parameters
parent (QWidget) – parent widget
db_mngr (SpineDBManager) – database manager
- class spinetoolbox.spine_db_editor.widgets.custom_delegates.EntityBynameDelegate(parent, db_mngr)[source]
Bases:
TableDelegate
A delegate for the entity byname.
- Parameters
parent (QWidget) – parent widget
db_mngr (SpineDBManager) – database manager
- class spinetoolbox.spine_db_editor.widgets.custom_delegates.AlternativeNameDelegate(parent, db_mngr)[source]
Bases:
TableDelegate
A delegate for the alternative name.
- Parameters
parent (QWidget) – parent widget
db_mngr (SpineDBManager) – database manager
- class spinetoolbox.spine_db_editor.widgets.custom_delegates.BooleanValueDelegate(parent, db_mngr)[source]
Bases:
TableDelegate
Base class for all custom stacked table delegates.
- db_mngr
database manager
- Type
- Parameters
parent (QWidget) – parent widget
db_mngr (SpineDBManager) – database manager
- class spinetoolbox.spine_db_editor.widgets.custom_delegates.AlternativeDelegate[source]
Bases:
PySide6.QtWidgets.QStyledItemDelegate
A delegate for the alternative tree.
- class spinetoolbox.spine_db_editor.widgets.custom_delegates.ScenarioDelegate(*args, **kwargs)[source]
Bases:
PySide6.QtWidgets.QStyledItemDelegate
A delegate for the scenario tree.
- Parameters
*args – arguments passed to QStyledItemDelegate
**kwargs – keyword arguments passed to QStyledItemDelegate
- setEditorData(editor, index)[source]
Do nothing. We’re setting editor data right away in createEditor.
- _update_alternative_ids(item)[source]
Updates available alternatives avoiding duplicates in a scenario.
Excludes alternatives that are already in the scenario
- Parameters
item (ScenarioAlternativeItem) – one of scenario’s scenario alternatives
- Returns
available alternative names
- Return type
list of str
- class spinetoolbox.spine_db_editor.widgets.custom_delegates.ParameterDefinitionNameAndDescriptionDelegate(parent, db_mngr)[source]
Bases:
TableDelegate
A delegate for the parameter_name and description columns in Parameter Definition Table View.
- Parameters
parent (QWidget) – parent widget
db_mngr (SpineDBManager) – database manager
- class spinetoolbox.spine_db_editor.widgets.custom_delegates.ParameterValueListDelegate[source]
Bases:
PySide6.QtWidgets.QStyledItemDelegate
A delegate for the parameter value list tree.
- class spinetoolbox.spine_db_editor.widgets.custom_delegates.ManageItemsDelegate[source]
Bases:
PySide6.QtWidgets.QStyledItemDelegate
A custom delegate for the model in {Add/Edit}ItemDialogs.
- close_editor(editor, index)[source]
Closes editor.
Needed by SearchBarEditor.
- Parameters
editor (QWidget) – editor widget
index (QModelIndex) – index that is being edited
- connect_editor_signals(editor, index)[source]
Connect editor signals if necessary.
- Parameters
editor (QWidget) – editor widget
index (QModelIndex) – index being edited
- class spinetoolbox.spine_db_editor.widgets.custom_delegates.ManageEntityClassesDelegate[source]
Bases:
ManageItemsDelegate
A delegate for the model and view in {Add/Edit}EntityClassesDialog.
- class spinetoolbox.spine_db_editor.widgets.custom_delegates.ManageEntitiesDelegate[source]
Bases:
ManageItemsDelegate
A delegate for the model and view in {Add/Edit}EntitiesDialog.
- class spinetoolbox.spine_db_editor.widgets.custom_delegates.RemoveEntitiesDelegate[source]
Bases:
ManageItemsDelegate
A delegate for the model and view in RemoveEntitiesDialog.
- class spinetoolbox.spine_db_editor.widgets.custom_delegates.MetadataDelegate[source]
Bases:
PySide6.QtWidgets.QStyledItemDelegate
A delegate for the name and value columns in Metadata Table View.
- class spinetoolbox.spine_db_editor.widgets.custom_delegates.ItemMetadataDelegate(item_metadata_model, metadata_model, column, parent)[source]
Bases:
PySide6.QtWidgets.QStyledItemDelegate
A delegate for name and value columns in item metadata editor.
- Parameters
item_metadata_model (ItemMetadataModel) – item metadata model
metadata_model (MetadataTableModel) – metadata model
column (int) – item metadata table column
parent (QObject, optional) – parent object