Make sure we mark the tree dirty when adding/removing an import-scene


The import scene injects itself into the layer's child list by setting
the dummy import-scene node's head and tail directly, deliberately
avoiding the normal add/remove path so the imported root's sibling
links and rootNodeRef aren't modified.

Mark the tree dirty explicitly in both setImportScene() and
removeImportScene() so the change triggers the needed reindex. On
removal we also reset the imported node's handle; we must not clear the
node's Imported state or rootNodeRef, as the node may be imported by
more than one view and neither is restored by the per-frame update.

The dummy import-scene node itself is added through addChild(), which
now front-inserts ImportScene nodes so the imported scene always gets
the lowest indices. That keeps a shared imported scene at the start
of a shared data store regardless of how many nodes a given view holds.
While here, simplify addChild()'s reparenting guard to only special-
case layer nodes.

Add tests covering the add/remove state transitions and the multi-view
sharing case.

Pick-to: 6.12 6.11
Change-Id: Ie1e5b063f7b64df06a26a57b074ba7b83d137dcf
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
commit53c4de134c67fb3e468869acb325105ec0817b65
parent8a1f66152a083987a8d124014a28ce3e2d6e63b1
authorChristian Strømme <christian.stromme@qt.io>
committerChristian Strømme <christian.stromme@qt.io>
commit timeFri, 24 Jul 2026 15:48:12 +0000