class documentation

class TableModel(QAbstractTableModel):

View In Hierarchy

TableModel class.
Method __init__ Initializes a table model.
Method columnCount Gets the number of columns. Note: Enabling allow_delete adds an extra column for the row delete buttons.
Method data Gets a cell value.
Method flags Gets the flags for a cell.
Method headerData Sets the header data.
Method is_widget Checks if the cell is a widget button.
Method rowCount Gets the number of rows.
Method setData Sets a cell value.
Instance Variable _col_is_widget Undocumented
Instance Variable _col_keys Undocumented
Instance Variable _data Undocumented
Instance Variable _row_keys Undocumented
def __init__(self, parent, data, row_keys, col_keys, col_is_widget=None):
Initializes a table model.
Parameters
parent:QTableViewQTableView
data:List[List]Data (2D)
row_keys:List[str]List of vertical header strings
col_keys:List[str]List of horizontal header strings
col_is_widget:Optional[List[bool]]Indicates columns contains only widgets instead of only data (may be None for data-only)
def columnCount(self, parent=None):
Gets the number of columns. Note: Enabling allow_delete adds an extra column for the row delete buttons.
Parameters
parent:QtCore.QModelIndexUndocumented
Returns
Number of columns
def data(self, index, role=Qt.DisplayRole):
Gets a cell value.
Parameters
index:QtCore.QModelIndexCell index
role:intData role
Returns
QVariantCell value
def flags(self, index):
Gets the flags for a cell.
Parameters
index:QtCore.QModelIndexCell index
Returns
intCell flags
def headerData(self, section, orientation, role=Qt.DisplayRole):
Sets the header data.
Parameters
section:intRow or column
orientation:Qt.OrientationOrientation
role:intData role
Returns
QVariantUndocumented
def is_widget(self, index):
Checks if the cell is a widget button.
Parameters
index:QtCore.QModelIndexCell index
Returns
boolTrue if the cell is a widget, False otherwise
def rowCount(self, parent=None):
Gets the number of rows.
Parameters
parent:QtCore.QModelIndexUndocumented
Returns
Number of rows
def setData(self, index, value, role=Qt.EditRole):
Sets a cell value.
Parameters
index:QtCore.QModelIndexCell index
value:AnyCell value
role:intData role
Returns
boolTrue if successful, False otherwise
_col_is_widget =

Undocumented

_col_keys =

Undocumented

_data =

Undocumented

_row_keys =

Undocumented