Details
-
Suggestion
-
Resolution: Unresolved
-
P4: Low
-
5.0.0
-
None
Description
Currently you have to use Loader (or worse, Qt.createComponent function) to initialize new content in a state change:
Loader { id: thumbnailLoader }
Component {
id: thumbComponent
Image {
MouseArea { ... }
Row { ... }
}
}
states: State {
when: "expanded"
PropertyChanges {
target: thumbnailLoader
sourceComponent: thumbComponent
}
}
Simpler syntax (that would also save the construction and geometry handling of the Loader item) could be obtained by introducing new state operation element called ChildCreate that would be responsible of the life time and parenting of the constructed child object:
states: State {
when: "expanded"
ChildCreate {
parent: window
Image {
MouseArea { ... }
Row { ... }
}
}
}