hamyar_paygah.view_models.mission_table_model

View model for Missions list table view.

Classes

MissionTableModel

Model for Qt TableView to show missions data.

Module Contents

class hamyar_paygah.view_models.mission_table_model.MissionTableModel(missions_list, parent=None)

Bases: PySide6.QtCore.QAbstractTableModel

Model for Qt TableView to show missions data.

Parameters:
_missions_list
_columns
rowCount(parent=QModelIndex())

Returns the number of rows under the given parent.

When the parent is valid it means that rowCount is returning the number of children of parent.

Return type:

int

columnCount(parent=QModelIndex())

Returns the number of columns for the children of the given parent.

In most subclasses, the number of columns is independent of the parent.

Return type:

int

data(index, role=Qt.DisplayRole)

Returns the data stored under the given role for the item referred to by the index.

Parameters:

index (PySide6.QtCore.QModelIndex)

Return type:

None | str

headerData(section, orientation, role=Qt.DisplayRole)

Returns the data for the given role and section in the header with the specified orientation.

For horizontal headers, the section number corresponds to the column number. Similarly, for vertical headers, the section number corresponds to the row number.

Return type:

None | str | int

get_mission(row)

Return mission by row index.

Parameters:

row (int)

Return type:

hamyar_paygah.models.mission_model.Mission