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>
commit7bf29431e8ea384be9ec9dbf3583026ff73f087b
parentd9ea2570f11b142c97b0cb04429df3fe5f950d7c
authorUlf Hermann <ulf.hermann@qt.io>
committerUlf Hermann <ulf.hermann@qt.io>
commit timeFri, 9 Oct 2026 12:46:26 +0000