spinetoolbox.mvcmodels.empty_row_model

Contains a table model with an empty last row.

authors:
  1. Marin (KTH)
date:

20.5.2018

Module Contents

class spinetoolbox.mvcmodels.empty_row_model.EmptyRowModel(parent=None, header=None)[source]

Bases: spinetoolbox.mvcmodels.minimal_table_model.MinimalTableModel

A table model with a last empty row.

Init class.

canFetchMore(self, parent=QModelIndex())[source]
fetchMore(self, parent=QModelIndex())[source]
flags(self, index)[source]

Return default flags except if forcing defaults.

set_default_row(self, **kwargs)[source]

Set default row data.

clear(self)[source]
reset_model(self, main_data=None)[source]
_handle_data_changed(self, top_left, bottom_right, roles=None)[source]

Insert a new last empty row in case the previous one has been filled with any data other than the defaults.

removeRows(self, row, count, parent=QModelIndex())[source]

Don’t remove the last empty row.

_handle_rows_inserted(self, parent, first, last)[source]

Handle rowsInserted signal.

set_rows_to_default(self, first, last=None)[source]

Set default data in newly inserted rows.