spinetoolbox.mvcmodels.indexed_value_table_model

A model for indexed parameter values, used by the parameter_value editors.

authors
  1. Soininen (VTT)

date

18.6.2019

Module Contents

Classes

IndexedValueTableModel

A base class for time pattern and time series models.

Attributes

EXPANSE_COLOR

spinetoolbox.mvcmodels.indexed_value_table_model.EXPANSE_COLOR[source]
class spinetoolbox.mvcmodels.indexed_value_table_model.IndexedValueTableModel(value, index_header, value_header)[source]

Bases: PySide2.QtCore.QAbstractTableModel

A base class for time pattern and time series models.

Parameters
  • value (TimePattern, TimeSeriesFixedStep, TimeSeriesVariableStep) – a parameter_value

  • index_header (str) – a header for the index column

  • value_header (str) – a header for the value column

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

Returns the number of columns which is two.

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

Returns the data at index for given role.

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

Returns a header.

is_expanse_row(self, row)[source]

Returns True if row is the expanse row.

Parameters

row (int) – a row

Returns

True if row is the expanse row, False otherwise

Return type

bool

reset(self, value)[source]

Resets the model.

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

Returns the number of rows.

property value(self)[source]

Returns the parameter_value associated with the model.