hamyar_paygah.view_models.consumables_table_model¶
View model for consumables list table in Mission details view.
Classes¶
Table model for displaying consumables used in a mission. |
Module Contents¶
- class hamyar_paygah.view_models.consumables_table_model.ConsumablesTableModel(items=None, parent=None)¶
Bases:
PySide6.QtCore.QAbstractTableModelTable model for displaying consumables used in a mission.
- Parameters:
items (collections.Counter[str] | None)
- COLUMN_ITEM = 0¶
- COLUMN_QUANTITY = 1¶
- set_items(items)¶
Replace model data with new consumables.
- Parameters:
items (collections.Counter[str])
- Return type:
None
- rowCount(parent=QModelIndex())¶
Returns the number of rows in the model.
which corresponds to the number of unique consumable items.
- Return type:
- data(index, role=Qt.DisplayRole)¶
Returns the data to be displayed for a given cell based on the role.
- Parameters:
index (PySide6.QtCore.QModelIndex)
- Return type:
- headerData(section, orientation, role=Qt.DisplayRole)¶
Returns the header data for the given section and orientation based on the role.
- Return type:
Literal[‘نوع’, ‘تعداد’] | None