spinetoolbox.spine_db_editor.widgets.manage_items_dialogs
Classes for custom QDialogs to add, edit and remove database items.
Attributes
Display string to separate items such as entity names. |
Classes
An entity_class item. |
|
An editor to let the user select an icon and a color for an object_class. |
|
Custom QTableView class with copy and paste methods. |
|
|
|
|
|
A dialog with a CopyPasteTableView and a QDialogButtonBox. Base class for all |
|
Provides a method to retrieve entity classes for AddEntitiesDialog and AddEntityClassesDialog. |
|
Provides a method to retrieve entities for AddEntitiesDialog and EditEntitiesDialog. |
|
Provides methods to show an IconColorEditor upon request. |
Functions
|
Decorator to change the mouse cursor to 'busy' while a function is processed. |
|
Module Contents
- class spinetoolbox.spine_db_editor.widgets.manage_items_dialogs.EntityClassItem(model, db_map_ids=None)[source]
Bases:
spinetoolbox.spine_db_editor.mvcmodels.multi_db_tree_item.MultiDBTreeItem
An entity_class item.
- Parameters:
model (MinimalTreeModel, optional) – item’s model
db_map_ids (dict, optional) – maps instances of DatabaseMapping to the id of the item in that db
- visual_key = ['name', 'dimension_name_list', 'superclass_name']
- item_type = 'entity_class'
- _fetch_index
- property display_icon
- Returns class icon.
- property child_item_class
- Returns the type of child items.
- property _children_sort_key
- Reimplemented so groups are above non-groups.
- default_parameter_data()[source]
Return data to put as default in a parameter table when this item is selected.
- property display_data
- Returns the name for display.
- property has_dimensions
- class spinetoolbox.spine_db_editor.widgets.manage_items_dialogs.IconColorEditor(parent)[source]
Bases:
PySide6.QtWidgets.QDialog
An editor to let the user select an icon and a color for an object_class.
- Parameters:
parent (QWidget) – parent widget
- reset_pressed
- class spinetoolbox.spine_db_editor.widgets.manage_items_dialogs.CopyPasteTableView(parent=None)[source]
Bases:
PySide6.QtWidgets.QTableView
Custom QTableView class with copy and paste methods.
- init_copy_and_paste_actions()[source]
Initializes copy and paste actions and connects relevant signals.
- set_external_copy_and_paste_actions(copy_action, paste_action)[source]
Sets the view to use external copy and paste actions.
Note that this doesn’t connect the actions’ trigger signals; the owner of the actions is responsible for handling them.
- Parameters:
copy_action (QAction) – copy action
paste_action (QAction) – paste action
- property copy_action
- property paste_action
- static _read_pasted_text(text)[source]
Parses a tab separated CSV text table.
- Parameters:
text (str) – a CSV formatted table
- Returns:
a list of rows
- Return type:
list
- spinetoolbox.spine_db_editor.widgets.manage_items_dialogs.busy_effect(func)[source]
Decorator to change the mouse cursor to ‘busy’ while a function is processed.
- Parameters:
func (Callable) – Decorated function.
- spinetoolbox.spine_db_editor.widgets.manage_items_dialogs.preferred_row_height(widget, factor=1.5)[source]
- spinetoolbox.spine_db_editor.widgets.manage_items_dialogs.DB_ITEM_SEPARATOR = ' ǀ '[source]
Display string to separate items such as entity names.
- class spinetoolbox.spine_db_editor.widgets.manage_items_dialogs.DialogWithButtons(parent, db_mngr)[source]
Bases:
PySide6.QtWidgets.QDialog
- Parameters:
parent (SpineDBEditor) – data store widget
db_mngr (SpineDBManager)
- class spinetoolbox.spine_db_editor.widgets.manage_items_dialogs.DialogWithTableAndButtons(parent, db_mngr)[source]
Bases:
DialogWithButtons
- Parameters:
parent (SpineDBEditor) – data store widget
db_mngr (SpineDBManager)
- class spinetoolbox.spine_db_editor.widgets.manage_items_dialogs.ManageItemsDialog(parent, db_mngr)[source]
Bases:
DialogWithTableAndButtons
A dialog with a CopyPasteTableView and a QDialogButtonBox. Base class for all dialogs to query user’s preferences for adding/editing/managing data items.
- Parameters:
parent (SpineDBEditor) – data store widget
db_mngr (SpineDBManager)
- class spinetoolbox.spine_db_editor.widgets.manage_items_dialogs.GetEntityClassesMixin[source]
Provides a method to retrieve entity classes for AddEntitiesDialog and AddEntityClassesDialog.
- class spinetoolbox.spine_db_editor.widgets.manage_items_dialogs.GetEntitiesMixin(*args, **kwargs)[source]
Provides a method to retrieve entities for AddEntitiesDialog and EditEntitiesDialog.