spinetoolbox.widgets.indexed_value_table_context_menu

Context menus for parameter value editor widgets.

Module Contents

Classes

ContextMenuBase

Context menu base for parameter value editor tables.

ArrayTableContextMenu

Context menu for array editor tables.

IndexedValueTableContextMenu

Context menu for time series and time pattern editor tables.

MapTableContextMenu

Context menu for map editor tables.

Functions

_unique_row_ranges(selections)

Merged ranges in given selections to unique ranges.

_unique_column_ranges(selections)

Merged ranges in given selections to unique ranges.

_merge_intervals(intervals)

Merges given intervals if they overlap.

Attributes

_INSERT_SINGLE_COLUMN_AFTER

_INSERT_SINGLE_ROW_AFTER

_INSERT_MULTIPLE_COLUMNS_AFTER

_INSERT_MULTIPLE_ROWS_AFTER

_INSERT_SINGLE_COLUMN_BEFORE

_INSERT_SINGLE_ROW_BEFORE

_INSERT_MULTIPLE_COLUMNS_BEFORE

_INSERT_MULTIPLE_ROWS_BEFORE

_OPEN_EDITOR

_PLOT

_PLOT_IN_WINDOW

_REMOVE_COLUMNS

_REMOVE_ROWS

_TRIM_COLUMNS

spinetoolbox.widgets.indexed_value_table_context_menu._INSERT_SINGLE_COLUMN_AFTER = 'Insert column after'[source]
spinetoolbox.widgets.indexed_value_table_context_menu._INSERT_SINGLE_ROW_AFTER = 'Insert row after'[source]
spinetoolbox.widgets.indexed_value_table_context_menu._INSERT_MULTIPLE_COLUMNS_AFTER = 'Insert columns after...'[source]
spinetoolbox.widgets.indexed_value_table_context_menu._INSERT_MULTIPLE_ROWS_AFTER = 'Insert rows after...'[source]
spinetoolbox.widgets.indexed_value_table_context_menu._INSERT_SINGLE_COLUMN_BEFORE = 'Insert column before'[source]
spinetoolbox.widgets.indexed_value_table_context_menu._INSERT_SINGLE_ROW_BEFORE = 'Insert row before'[source]
spinetoolbox.widgets.indexed_value_table_context_menu._INSERT_MULTIPLE_COLUMNS_BEFORE = 'Insert columns before...'[source]
spinetoolbox.widgets.indexed_value_table_context_menu._INSERT_MULTIPLE_ROWS_BEFORE = 'Insert rows before...'[source]
spinetoolbox.widgets.indexed_value_table_context_menu._OPEN_EDITOR = 'Edit...'[source]
spinetoolbox.widgets.indexed_value_table_context_menu._PLOT = 'Plot...'[source]
spinetoolbox.widgets.indexed_value_table_context_menu._PLOT_IN_WINDOW = 'Plot in window'[source]
spinetoolbox.widgets.indexed_value_table_context_menu._REMOVE_COLUMNS = 'Remove columns'[source]
spinetoolbox.widgets.indexed_value_table_context_menu._REMOVE_ROWS = 'Remove rows'[source]
spinetoolbox.widgets.indexed_value_table_context_menu._TRIM_COLUMNS = 'Trim columns'[source]
class spinetoolbox.widgets.indexed_value_table_context_menu.ContextMenuBase(table_view, position)[source]

Bases: PySide6.QtWidgets.QMenu

Context menu base for parameter value editor tables.

Parameters
  • table_view (QTableView) – the view where the menu is invoked

  • position (QPoint) – menu’s position on the table view

_add_default_actions()[source]

Adds default actions to the menu.

_first_row()[source]

Returns the first selected row.

Returns

index to the first row

Return type

int

_insert_multiple_rows_after()[source]

Prompts for row count, then inserts new rows below the current selection.

_insert_multiple_rows_before()[source]

Prompts for row count, then inserts new rows above the current selection.

_insert_single_row_after()[source]

Inserts a single row below the current selection.

_insert_single_row_before()[source]

Inserts a single row above the current selection.

_last_row()[source]

Returns the last selected row.

Returns

index to the last row

Return type

int

_prompt_row_count()[source]

Prompts for number of rows to insert.

Returns

number of rows

Return type

int

_remove_rows()[source]

Removes selected rows.

class spinetoolbox.widgets.indexed_value_table_context_menu.ArrayTableContextMenu(editor, table_view, position)[source]

Bases: ContextMenuBase

Context menu for array editor tables.

Parameters
  • editor (ArrayEditor) – array editor widget

  • table_view (QTableView) – the view where the menu is invoked

  • position (QPoint) – menu’s position

_show_value_editor()[source]

Opens the value element editor.

class spinetoolbox.widgets.indexed_value_table_context_menu.IndexedValueTableContextMenu(table_view, position)[source]

Bases: ContextMenuBase

Context menu for time series and time pattern editor tables.

Parameters
  • table_view (QTableView) – the view where the menu is invoked

  • position (QPoint) – menu’s position

class spinetoolbox.widgets.indexed_value_table_context_menu.MapTableContextMenu(editor, table_view, position)[source]

Bases: ContextMenuBase

Context menu for map editor tables.

Parameters
  • editor (MapEditor) – map editor widget

  • table_view (QTableView) – the view where the menu is invoked

  • position (QPoint) – table cell index

_first_column()[source]

Returns the first selected column.

Returns

index to the first column

Return type

int

_insert_multiple_columns_after()[source]

Prompts for column count, then inserts new columns right from the current selection.

_insert_multiple_columns_before()[source]

Prompts for column count, then inserts new columns left from the current selection.

_insert_single_column_before()[source]

Inserts a single column left from the current selection.

_insert_single_column_after()[source]

Inserts a single column right from the current selection.

_last_column()[source]

Returns the last selected column.

Returns

index to the last column

Return type

int

_prompt_column_count()[source]

Prompts for number of column to insert.

Returns

number of columns

Return type

int

_remove_columns()[source]

Removes selected columns

_show_value_editor()[source]

Opens the value element editor.

_plot(checked=False)[source]

Plots current indexes.

_plot_in_window(action)[source]

Plots the selected cells in an existing window.

_trim_columns()[source]

Removes excessive columns from the table.

spinetoolbox.widgets.indexed_value_table_context_menu._unique_row_ranges(selections)[source]

Merged ranges in given selections to unique ranges.

Parameters

selections (list of QItemSelectionRange) – selected ranges

Returns

a list of [first_row, last_row] ranges

Return type

list of list

spinetoolbox.widgets.indexed_value_table_context_menu._unique_column_ranges(selections)[source]

Merged ranges in given selections to unique ranges.

Parameters

selections (list of QItemSelectionRange) – selected ranges

Returns

a list of [first_row, last_row] ranges

Return type

list of list

spinetoolbox.widgets.indexed_value_table_context_menu._merge_intervals(intervals)[source]

Merges given intervals if they overlap.

Parameters

intervals (list of list) – a list of intervals in the form [first, last]

Returns

merged intervals in the form [first, last]

Return type

list of list