hamyar_paygah.view_models.consumables_table_model ================================================= .. py:module:: hamyar_paygah.view_models.consumables_table_model .. autoapi-nested-parse:: View model for consumables list table in Mission details view. Classes ------- .. autoapisummary:: hamyar_paygah.view_models.consumables_table_model.ConsumablesTableModel Module Contents --------------- .. py:class:: ConsumablesTableModel(items = None, parent=None) Bases: :py:obj:`PySide6.QtCore.QAbstractTableModel` Table model for displaying consumables used in a mission. .. py:attribute:: COLUMN_ITEM :value: 0 .. py:attribute:: COLUMN_QUANTITY :value: 1 .. py:attribute:: _items :type: list[tuple[str, int]] :value: [] .. py:method:: set_items(items) Replace model data with new consumables. .. py:method:: rowCount(parent=QModelIndex()) Returns the number of rows in the model. which corresponds to the number of unique consumable items. .. py:method:: columnCount(parent=QModelIndex()) Returns the number of columns in the model. .. py:method:: data(index, role=Qt.DisplayRole) Returns the data to be displayed for a given cell based on the role. .. py:method:: headerData(section, orientation, role=Qt.DisplayRole) Returns the header data for the given section and orientation based on the role.