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.

parent

The parent of this view

Type:QWidget

Initialize the view.

value_column_header[source]

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

connect_data_store_form(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.

create_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: spinetoolbox.spine_db_editor.widgets.custom_qtableview.ParameterTableView

Custom QTableView class with autofilter functionality.

parent

The parent of this view

Type:QWidget

Initialize the view.

value_column_header[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: spinetoolbox.spine_db_editor.widgets.custom_qtableview.ParameterTableView

Custom QTableView class with autofilter functionality.

parent

The parent of this view

Type:QWidget

Initialize the view.

value_column_header[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.ObjectParameterDefinitionTableView(parent)[source]

Bases: spinetoolbox.spine_db_editor.widgets.custom_qtableview.ObjectParameterTableMixin, spinetoolbox.spine_db_editor.widgets.custom_qtableview.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: spinetoolbox.spine_db_editor.widgets.custom_qtableview.RelationshipParameterTableMixin, spinetoolbox.spine_db_editor.widgets.custom_qtableview.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: spinetoolbox.spine_db_editor.widgets.custom_qtableview.ObjectParameterTableMixin, spinetoolbox.spine_db_editor.widgets.custom_qtableview.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: spinetoolbox.spine_db_editor.widgets.custom_qtableview.RelationshipParameterTableMixin, spinetoolbox.spine_db_editor.widgets.custom_qtableview.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 selected objects[source]
_REMOVE_RELATIONSHIP = Remove selected relationships[source]
_REMOVE_PARAMETER = Remove selected parameter definitions[source]
source_model[source]
db_mngr[source]
db_map[source]
connect_data_store_form(self, spine_db_editor)[source]
create_context_menu(self)[source]
remove_selected(self)[source]
remove_values(self)[source]
remove_objects(self)[source]
remove_relationships(self)[source]
remove_parameters(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) –
_find_selected_indexes(self)[source]
_update_actions_availability(self)[source]
_update_actions_text(self)[source]
_plot_in_window(self, action)[source]
class spinetoolbox.spine_db_editor.widgets.custom_qtableview.FrozenTableView(parent=None)[source]

Bases: PySide2.QtWidgets.QTableView

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