Details
-
Technical task
-
Resolution: Unresolved
-
P2: Important
-
None
-
None
-
None
Description
setParentItem calls QQuickWindowPrivate::updateFocusItem, which calls parentItem on various items in turn. Moreover, it is possible to trigger a setParentItem call in response to a focus change, complicating things even further.
This leaves no easy way to implement the parent property as a QProperty, as there are two "phases": A first phase where parentItem needs to return the old parent, and a second one where the new item has to be returned. While in theory it would be possible to model this with the guard and callback functions, the two phases share some state which currently cannot be passed from guard to callback (at least not without adding a new member).