Fix range-loop detach in containers: non-trivial case


A range-for loop over non-const COW Qt containers can cause a detach.

The code in question first iterates over info.inUseIds list, and then
unconditionally clears the list after the loop.
Rewrite it to first take the current list from the struct (as a const
object) and then iterate over it.

Axivion-Id: qt_Add-ons_qtpositioning_dev_linux:SV207
Task-number: QTBUG-144769
Pick-to: 6.11 6.10 6.8 6.5
Change-Id: Ic0a609a10e606462cb61d03f356a758113077e77
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
commit5880cb32c6a8d683b847ad4a75d04d0956622322
parent3a0e69449d7a5ff6bf5fc7f78eed556e64a6932a
authorIvan Solovev <ivan.solovev@qt.io>
committerIvan Solovev <ivan.solovev@qt.io>
commit timeTue, 10 Mar 2026 08:54:17 +0100