ProtobufScalarJsonSerializers: avoid detaches when iterating containers


Mark the array(s) const to avoid unexpected detaches when using range
based for loops.

Also mark the iterating-value const-ref for performance and correctness.

Furthermore resolve the shadowing of a 'value' variable, which is
already a function argument.

Amends 6a1012792c8909e70c2636b75961e7a8bb949031.

Pick-to: 6.11 6.10 6.8
Task-number: QTBUG-144771
Change-Id: Ia040bc91d45161ac3453221f51ad34786ff1138c
Axivion-Id: qt_Add-ons_qtgrpc_dev_linux:SV120
Axivion-Id: qt_Add-ons_qtgrpc_dev_linux:SV121
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
commita90177582d1250aca8430e8364efc1f063dbff2c
parent5e433c0aea66ba883263020a88687f1d97bfeacc
authorDennis Oberst <dennis.oberst@qt.io>
committerDennis Oberst <dennis.oberst@qt.io>
commit timeFri, 13 Mar 2026 09:17:48 +0000