parent_child_ref
freecad.datamanager_wb.domain.parent_child_ref
¶
Typed parent/child references for list widget selections.
The UI stores these objects in QListWidgetItem user data to preserve a
structured representation of parent.child identifiers.
ParentChildRef(parent, child)
dataclass
¶
Structured identifier of a parent.child reference.
This type is used as a stable representation of list items in the UI (VarSet variables and Spreadsheet aliases). The UI often renders items as a string but needs to retain the structured parts for querying and mutations.
Attributes:
| Name | Type | Description |
|---|---|---|
parent |
str
|
The parent container name (e.g. VarSet name, Spreadsheet name). |
child |
str
|
The child identifier within the parent (e.g. variable/alias). |
normalize_parent_child_items(items)
¶
Normalize a list of selection items to their parent.child string form.
Source code in freecad/datamanager_wb/domain/parent_child_ref.py
parse_parent_child_ref(text)
¶
Parse a parent.child string into a :class:ParentChildRef.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
text
|
str
|
A string expected to contain exactly one dot separating parent and child. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
A |
ParentChildRef | None
|
class: |