Avoid detaches when iterating over QList without modifying
Use std::as_const in ranged-for or make const copies of the list before
iterating, and prefer element access with QList::at over operator[]. If
possible, pass elements through as const as well.
Amends 00393d5d9251fc85be401a89088edfb2a122b972 to address static
analyser warnings.
Axivion-Id: qt_Add-ons_qtcharts_dev_linux:SV821
Axivion-Id: qt_Add-ons_qtcharts_dev_linux:SV822
Pick-to: 6.12 6.11
Task-number: QTBUG-146050
Change-Id: I4cee614293f4d22d5b4727f9304ca94d13948cdb
Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
Reviewed-by: Sami Varanka <sami.varanka@qt.io>