spinetoolbox.mvcmodels.array_model
¶
Contains logic for the fixed step time series editor widget.
- author
Soininen (VTT)
- date
14.6.2019
Module Contents¶
Classes¶
Model for the Array parameter_value type. |
- class spinetoolbox.mvcmodels.array_model.ArrayModel[source]¶
Bases:
PySide2.QtCore.QAbstractTableModel
Model for the Array parameter_value type.
Even if the array is empty this model’s rowCount() will still return 1. This is to show an empty row in the table view.
- batch_set_data(self, indexes, values)[source]¶
Sets data at multiple indexes at once.
- Parameters
indexes (list of QModelIndex) – indexes to set
values (list of str) – values corresponding to the indexes
- _convert_to_data_type(self, indexes, values)[source]¶
Converts values from string to current data type filtering failed conversions.
- Parameters
indexes (list of QModelIndex) – indexes
values (list of str) – values to convert
- Returns
indexes and converted values
- Return type
tuple
- is_expanse_row(self, row)[source]¶
Returns True if row is the expanse row.
- Parameters
row (int) – a row
- Returns
True is row is expanse row, False otherwise
- Return type
bool
- reset(self, value)[source]¶
Resets the model to a new array.
- Parameters
value (Array) – a new array to model
- rowCount(self, parent=QModelIndex())[source]¶
Returns the length of the array.
Note: returns 1 even if the array is empty.