spinetoolbox.spine_db_editor.widgets.tree_view_mixin

Contains the TreeViewMixin class.

author:
  1. Marin (KTH)
date:

26.11.2018

Module Contents

Classes

TreeViewMixin Provides object and relationship trees for the Spine db editor.
class spinetoolbox.spine_db_editor.widgets.tree_view_mixin.TreeViewMixin(*args, **kwargs)[source]

Provides object and relationship trees for the Spine db editor.

Initialize self. See help(type(self)) for accurate signature.

_object_classes_added[source]
_relationship_classes_added[source]
_object_classes_fetched[source]
_relationship_classes_fetched[source]

Emitted from fetcher thread, connected to Slots in GUI thread.

add_menu_actions(self)[source]

Adds toggle view actions to View menu.

connect_signals(self)[source]

Connects signals to slots.

init_models(self)[source]

Initializes models.

_handle_object_tree_selection_changed(self, selected, deselected)[source]

Updates object filter and sets default rows.

_handle_relationship_tree_selection_changed(self, selected, deselected)[source]

Updates relationship filter and sets default rows.

static _clear_tree_selections_silently(tree_view)[source]

Clears the selections on a given abstract item view without emitting any signals.

static _db_map_items(indexes)[source]

Groups items from given tree indexes by db map.

Returns:lists of dictionary items keyed by DiffDatabaseMapping
Return type:dict
_db_map_ids(self, indexes)[source]
_db_map_class_ids(self, indexes)[source]
export_selected(self, selected_indexes)[source]

Exports data from given indexes in the entity tree.

duplicate_object(self, index)[source]

Duplicates the object at the given object tree model index.

Parameters:index (QModelIndex) –
show_add_object_classes_form(self, checked=False)[source]

Shows dialog to add new object classes.

show_add_objects_form(self, checked=False, class_name='')[source]

Shows dialog to add new objects.

show_add_object_group_form(self, object_class_item)[source]

Shows dialog to add new object group.

show_manage_object_group_form(self, object_item)[source]

Shows dialog to manage an object group.

show_add_relationship_classes_form(self, checked=False, object_class_one_name=None)[source]

Shows dialog to add new relationship_class.

show_add_relationships_form(self, checked=False, relationship_class_key=None, object_names_by_class_name=None)[source]

Shows dialog to add new relationships.

show_manage_relationships_form(self, checked=False, relationship_class_key=None)[source]
edit_entity_tree_items(self, selected_indexes)[source]

Starts editing given indexes.

show_edit_object_classes_form(self, items)[source]
show_edit_objects_form(self, items)[source]
show_edit_relationship_classes_form(self, items)[source]
show_remove_alternative_tree_items_form(self)[source]

Shows form to remove items from object treeview.

show_edit_relationships_form(self, items)[source]
show_remove_entity_tree_items_form(self, selected_indexes)[source]

Shows form to remove items from object treeview.

notify_items_changed(self, action, item_type, db_map_data)[source]

Enables or disables actions and informs the user about what just happened.

receive_alternatives_fetched(self, db_map_data)[source]
receive_scenarios_fetched(self, db_map_data)[source]
receive_object_classes_fetched(self, db_map_data)[source]
receive_relationship_classes_fetched(self, db_map_data)[source]
receive_alternatives_added(self, db_map_data)[source]
receive_scenarios_added(self, db_map_data)[source]
receive_object_classes_added(self, db_map_data)[source]
receive_objects_added(self, db_map_data)[source]
receive_relationship_classes_added(self, db_map_data)[source]
receive_relationships_added(self, db_map_data)[source]
receive_alternatives_updated(self, db_map_data)[source]
receive_scenarios_updated(self, db_map_data)[source]
receive_entity_groups_added(self, db_map_data)[source]
receive_object_classes_updated(self, db_map_data)[source]
receive_objects_updated(self, db_map_data)[source]
receive_relationship_classes_updated(self, db_map_data)[source]
receive_relationships_updated(self, db_map_data)[source]
receive_alternatives_removed(self, db_map_data)[source]
receive_scenarios_removed(self, db_map_data)[source]
receive_object_classes_removed(self, db_map_data)[source]
receive_objects_removed(self, db_map_data)[source]
receive_relationship_classes_removed(self, db_map_data)[source]
receive_relationships_removed(self, db_map_data)[source]
receive_entity_groups_removed(self, db_map_data)[source]