QmlPreview: Mark retired subtrees as queued for deletion
When rebuilding the document root, its old children are retired and
scheduled for deletion. Their descendants, however, may themselves be
pending rebuild targets, for example inline component instances nested
inside a layout. Since only the retired object itself was scheduled,
those descendants were still rebuilt afterwards, using their stale
object indices against the new compilation unit. If an object was
added before them, the indices pointed to different objects, which
produced bogus bindings and crashed when writing properties.
Mark the whole retired subtree as queued for deletion right away, so
that rebuildObject() skips it.
Pick-to: 6.12
Fixes: QTBUG-151189
Change-Id: I99d7ba885c92fb66533c62b20e8dfbe65f7cf997
Reviewed-by: Semih Yavuz <semih.yavuz@qt.io>
Reviewed-by: Olivier De Cannière <olivier.decanniere@qt.io>