fontlabapp.qt.trees.draft.DraftTree
DraftTree
Copy a complete Tree into an owned draft; callers never receive lists.
Root ID is zero. Input row N becomes node N+1. Mutation arguments are strict text/integers; adapters convert Qt values at their own boundary. Rejected edits leave all data and the next identity unchanged. A million-cell limit bounds accidental huge allocations, including trees with zero columns.
Complete member index
Every captured member retains its own identity. Identical captured declaration text is linked once; this does not establish native inheritance or interchangeable objects.
| Member | Kind | Signature | Summary |
|---|---|---|---|
__init__ |
function | (self, source: Tree) -> None |
|
cells |
function | (self, identity: int) -> tuple[object, ...] |
Return an immutable copy of row cells, or headers for the root. |
children |
function | (self, identity: int) -> tuple[int, ...] |
Return immediate children in visible row order. |
column_count |
attribute | (self) -> int |
Return global column count, which may be zero after removal. |
fork |
function | (self) -> 'DraftTree' |
Copy containers for complete edit preflight before Qt notifications. |
identities |
function | (self) -> tuple[int, ...] |
Return all live IDs, root first, in allocation order. |
insert_columns |
function | (self, position: int, count: int, header: str='Column') -> None |
Insert global columns while preserving hierarchy and node IDs. |
insert_rows |
function | (self, parent: int, position: int, count: int, cells: tuple[str, ...]) -> tuple[int, ...] |
Insert independent equal rows; return their fresh occurrence IDs. |
parent |
function | (self, identity: int) -> int | None |
Return the parent ID; only root has no parent. |
position |
function | (self, identity: int) -> int |
Return the current sibling position, refusing the invisible root. |
remove_columns |
function | (self, position: int, count: int) -> None |
Remove global columns; callers choose whether to drop empty rows. |
remove_rows |
function | (self, parent: int, position: int, count: int) -> tuple[int, ...] |
Remove rows and complete descendant subtrees without recursion. |
set_cell |
function | (self, identity: int, column: int, value: str) -> None |
Set one text cell or header; no data coercion hides invalid values. |
set_value |
function | (self, identity: int, column: int, value: object) -> None |
Retain an edited QVariant value for the official example's policy. |