spinetoolbox.project_items.exporter.mvcmodels.indexing_table_model

Contains IndexingTableModel.

author:
  1. Soininen (VTT)
date:

25.8.2020

Module Contents

Classes

IndexingTableModel A table model for parameter_value indexing.
class spinetoolbox.project_items.exporter.mvcmodels.indexing_table_model.IndexingTableModel(parameter)[source]

Bases: PySide2.QtCore.QAbstractTableModel

A table model for parameter_value indexing.

First column contains the proposed new index keys. The rest of the columns contain the parameter values for each set of existing index keys. Only selected new index keys are used for indexing. Unselected rows are left empty.

Parameters:parameter (Parameter) – a parameter to model
selection_changed[source]

Emitted after the values have been spread over the selected indexes.

manual_selection[source]

Emitted when the selection has been changed by setData().

get_picking(self)[source]

Turns the checked record into picking.

Returns:picked records
Return type:FixedPicking
canFetchMore(self, parent)[source]

Returns True if more rows are available to show.

clear(self)[source]

Clears the model.

columnCount(self, parent=QModelIndex())[source]

Returns the number of columns.

data(self, index, role=Qt.DisplayRole)[source]

Returns data associated with given model index and role.

headerData(self, section, orientation, role=Qt.DisplayRole)[source]

Returns header data.

fetchMore(self, parent)[source]

Inserts a number of new rows to the table.

flags(self, index)[source]

Returns flags for given index.

mapped_values_balance(self)[source]

Returns the balance between available indexes and parameter values.

Zero means that there is as many indexes available as there are values, i.e. the parameter is ‘perfectly’ indexed. A positive value means there are more indexes than values while a negative value means there are not enough indexes for all values.

Returns:mapped values’ balance
Return type:int
rowCount(self, parent=QModelIndex())[source]

Return the number of rows.

select_all(self)[source]

Selects all indexes.

setData(self, index, value, role=Qt.EditRole)[source]

Sets the checked state for given index.

set_index_name(self, name)[source]

Sets the indexing domain name.

set_records(self, records, pick_list=None)[source]

Overwrites all new indexes.

set_picking(self, picking)[source]

Selects the indexes specified by picking.

Parameters:picking (Picking) – picking
_spread_values_over_selected_rows(self, first_row)[source]

Repopulates the table according to selected indexes.