|
None | __init__ (self, parent=None, data=[]) |
|
Any | data (self, QModelIndex index, int _=...) |
|
int | rowCount (self, QModelIndex parent=...) |
|
int | columnCount (self, QModelIndex parent=...) |
|
| rows (self) |
|
| rows (self, List[Dict[str, Any]] rows) |
|
| headers (self) |
|
| headers (self, List[str] headers) |
|
None | clear (self) |
|
|
Any | _rows = data |
|
dict | _headers = {} |
|
Replacement Model for qt.labs.models.TableModel which was removed from PyQT6
◆ clear()
None UM.Qt.Bindings.TableModel.TableModel.clear |
( |
| self | ) |
|
◆ data()
Any UM.Qt.Bindings.TableModel.TableModel.data |
( |
| self, |
|
|
QModelIndex | index, |
|
|
int | _ = ... ) |
Example:
rows = [{name: "Jeff", age: 100, height: 10.2}, ....]
headers = { 0: "name", 1: "age", 2: "height" }
row = 0 # index of row in rows
column = 2 # index of header in headers
return rows[0]["height"]
◆ headers()
UM.Qt.Bindings.TableModel.TableModel.headers |
( |
| self, |
|
|
List[str] | headers ) |
Stores headers and indexes as dictionary, this is used for quick lookup in data()
headers = ["name", "age", "height"]
self._headers = { 0: "name", 1: "age", 2: "height" }
The documentation for this class was generated from the following file:
- UM/Qt/Bindings/TableModel.py