balsam: Reset the QML id allocator between assets


writeQml() allocates component-unique ids through three process-wide
statics that were never cleared, one of them keyed by node pointer.
balsam converts every positional argument in the same process and each
scene releases its nodes before the next one is built, so a new node
allocated at a freed node's address takes a false hit and is handed the
previous asset's id. Only the first asset of a run comes out correct;
the rest get ids belonging to their predecessor throughout, so the
generated component either fails to load or binds to the wrong objects.
Reset all three from one helper called by both exported entry points
that allocate ids, writeQml() and writeQmlComponent(), the latter being
exposed to the same hazard whenever the material editor rebuilds its
scene between exports. A test converts one asset twice in a single
process and requires the two generated components to be identical.

Pick-to: 6.12 6.11 6.8
Change-Id: I4825fc2a6fa2d34fecc1a5d31b4400e24d7d550a
Reviewed-by: Christian Strømme <christian.stromme@qt.io>
commitc0945182f53927640b53dc1a9d70478a899b12a0
parent315d0381d571031b05b8f6df41698d3a8a8def28
authorAndy Nichols <andy.nichols@qt.io>
committerAndy Nichols <andy.nichols@qt.io>
commit timeThu, 6 Aug 2026 12:04:45 +0000