Get rid of some clazy warnings in graphs2d/piechart folder

Fix "c++11 range-loop might detach Qt container" warnings.

Pick-to: 6.9
Change-Id: I3a61992a654fb09838ae005a67c0085eb8c1421c
Reviewed-by: Jere Tuliniemi <jere.tuliniemi@qt.io>
(cherry picked from commit 59d8120076)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Tomi Korpipaa 2025-07-09 12:40:46 +03:00 committed by Qt Cherry-pick Bot
parent 6b879d4250
commit bde33c5619
1 changed files with 2 additions and 1 deletions

View File

@ -555,7 +555,8 @@ QPieSlice *QPieSeries::at(qsizetype index)
*/ */
QPieSlice *QPieSeries::find(const QString &label) QPieSlice *QPieSeries::find(const QString &label)
{ {
for (QPieSlice *slice : slices()) { auto slicelist = slices();
for (QPieSlice *slice : std::as_const(slicelist)) {
if (slice->label() == label) if (slice->label() == label)
return slice; return slice;
} }