May 2019
Intermediate to advanced
542 pages
13h 37m
English
To create instances of our model to display data in a view, we need to implement three methods:
rowCount() and columnCount() are easy enough in this case:
def rowCount(self, parent): return len(self._data) def columnCount(self, parent): return len(self._headers)
The row count is just the length of the _data property, and the column count can be had by taking the length of the _headers property. Both functions are required to take a parent argument, but in this case, it is not used as it refers to the parent node, ...
Read now
Unlock full access