QmlPreview: Parent rebuilt inner instances to their outer's new context


Rebuilding a component root replaces the contexts it is the context
object of: its outer context and the contexts of its composite base
levels. Instances of inner components created in one of those contexts
were then rebuilt with a new context parented to the old one. Ids of
the enclosing component resolved against the old context, whose
objects had been retired, and came back as null.

Record which contexts are replaced during a rebuild, and parent the new
contexts of later rebuilt instances to the replacements.

Pick-to: 6.12
Task-number: QTBUG-151189
Change-Id: Ic5f6d031a00cfc11aec8c2c1249f14160ff7382d
Reviewed-by: Olivier De Cannière <olivier.decanniere@qt.io>
commit634f8275e7bd61dfd8b18a658825144473b6230f
parent9adfda0b49979c027e13a5d330b58d487cba14b4
authorUlf Hermann <ulf.hermann@qt.io>
committerUlf Hermann <ulf.hermann@qt.io>
commit timeFri, 9 Oct 2026 12:46:34 +0000