spinetoolbox.spine_db_editor.widgets.custom_qtableview

Custom QTableView classes that support copy-paste and the like.

author
  1. Marin (KTH)

date

18.5.2018

Module Contents

Classes

ParameterTableView

Custom QTableView class with autofilter functionality.

ObjectParameterTableMixin

RelationshipParameterTableMixin

ParameterDefinitionTableView

Custom QTableView class with autofilter functionality.

ParameterValueTableView

Custom QTableView class with autofilter functionality.

ObjectParameterDefinitionTableView

A custom QTableView for the object parameter_definition pane in Spine db editor.

RelationshipParameterDefinitionTableView

A custom QTableView for the relationship parameter_definition pane in Spine db editor.

ObjectParameterValueTableView

A custom QTableView for the object parameter_value pane in Spine db editor.

RelationshipParameterValueTableView

A custom QTableView for the relationship parameter_value pane in Spine db editor.

PivotTableView

Custom QTableView class with pivot capabilities.

FrozenTableView

class spinetoolbox.spine_db_editor.widgets.custom_qtableview.ParameterTableView(parent)[source]

Bases: spinetoolbox.widgets.custom_qtableview.AutoFilterCopyPasteTableView

Custom QTableView class with autofilter functionality.

Initialize the view.

property value_column_header(self)[source]

Either “default value” or “value”. Used to identifiy the value column for advanced editting and plotting.

connect_spine_db_editor(self, spine_db_editor)[source]

Connects a Spine db editor to work with this view.

Parameters

spine_db_editor (SpineDBEditor) –

_make_delegate(self, column_name, delegate_class)[source]

Creates a delegate for the given column and returns it.

Parameters
Returns

ParameterDelegate

create_delegates(self)[source]

Creates delegates for this view

open_in_editor(self)[source]

Opens the current index in a parameter_value editor using the connected Spine db editor.

plot(self, checked=False)[source]

Plots current index.

plot_in_window(self, action)[source]

Plots current index in the window given by action’s name.

populate_context_menu(self)[source]

Creates a context menu for this view.

contextMenuEvent(self, event)[source]

Shows context menu.

Parameters

event (QContextMenuEvent) –

_selected_rows_per_column(self)[source]

Computes selected rows per column.

Returns

Mapping columns to selected rows in that column.

Return type

dict

filter_by_selection(self, checked=False)[source]
filter_excluding_selection(self, checked=False)[source]
remove_selected(self)[source]

Removes selected indexes.

class spinetoolbox.spine_db_editor.widgets.custom_qtableview.ObjectParameterTableMixin[source]
create_delegates(self)[source]
class spinetoolbox.spine_db_editor.widgets.custom_qtableview.RelationshipParameterTableMixin[source]
create_delegates(self)[source]
class spinetoolbox.spine_db_editor.widgets.custom_qtableview.ParameterDefinitionTableView(parent)[source]

Bases: ParameterTableView

Custom QTableView class with autofilter functionality.

Initialize the view.

property value_column_header(self)[source]

Either “default value” or “value”. Used to identifiy the value column for advanced editting and plotting.

create_delegates(self)[source]

Creates delegates for this view

class spinetoolbox.spine_db_editor.widgets.custom_qtableview.ParameterValueTableView(parent)[source]

Bases: ParameterTableView

Custom QTableView class with autofilter functionality.

Initialize the view.

property value_column_header(self)[source]

Either “default value” or “value”. Used to identifiy the value column for advanced editting and plotting.

create_delegates(self)[source]

Creates delegates for this view

populate_context_menu(self)[source]

Creates a context menu for this view.

show_value_metadata(self)[source]
class spinetoolbox.spine_db_editor.widgets.custom_qtableview.ObjectParameterDefinitionTableView(parent)[source]

Bases: ObjectParameterTableMixin, ParameterDefinitionTableView

A custom QTableView for the object parameter_definition pane in Spine db editor.

Initialize the view.

class spinetoolbox.spine_db_editor.widgets.custom_qtableview.RelationshipParameterDefinitionTableView(parent)[source]

Bases: RelationshipParameterTableMixin, ParameterDefinitionTableView

A custom QTableView for the relationship parameter_definition pane in Spine db editor.

Initialize the view.

class spinetoolbox.spine_db_editor.widgets.custom_qtableview.ObjectParameterValueTableView(parent)[source]

Bases: ObjectParameterTableMixin, ParameterValueTableView

A custom QTableView for the object parameter_value pane in Spine db editor.

Initialize the view.

create_delegates(self)[source]

Creates delegates for this view

class spinetoolbox.spine_db_editor.widgets.custom_qtableview.RelationshipParameterValueTableView(parent)[source]

Bases: RelationshipParameterTableMixin, ParameterValueTableView

A custom QTableView for the relationship parameter_value pane in Spine db editor.

Initialize the view.

create_delegates(self)[source]

Creates delegates for this view

class spinetoolbox.spine_db_editor.widgets.custom_qtableview.PivotTableView(parent=None)[source]

Bases: spinetoolbox.widgets.custom_qtableview.CopyPasteTableView

Custom QTableView class with pivot capabilities.

Initialize the class.

_REMOVE_OBJECT = Remove objects[source]
_REMOVE_RELATIONSHIP = Remove relationships[source]
_REMOVE_PARAMETER = Remove parameter definitions[source]
_REMOVE_ALTERNATIVE = Remove alternatives[source]
_REMOVE_SCENARIO = Remove scenarios[source]
property source_model(self)[source]
property db_mngr(self)[source]
connect_spine_db_editor(self, spine_db_editor)[source]
populate_context_menu(self)[source]
remove_selected(self)[source]
remove_values(self)[source]
remove_objects(self)[source]
remove_relationships(self)[source]
remove_parameters(self)[source]
remove_alternatives(self)[source]
remove_scenarios(self)[source]
open_in_editor(self)[source]

Opens the parameter_value editor for the first selected cell.

plot(self)[source]

Plots the selected cells in the pivot table.

contextMenuEvent(self, event)[source]

Shows context menu.

Parameters

event (QContextMenuEvent) –

_refresh_selected_indexes(self)[source]
_update_actions_availability(self)[source]
_can_remove_relationships(self)[source]
_plot_in_window(self, action)[source]
class spinetoolbox.spine_db_editor.widgets.custom_qtableview.FrozenTableView[source]

Bases: PySide2.QtWidgets.QTableView

header_dropped[source]
property area(self)[source]
dragEnterEvent(self, event)[source]
dragMoveEvent(self, event)[source]
dropEvent(self, event)[source]