QMdiArea: port Q_FOREACH to ranged-for, d->pendingPlacements

Task-number: QTBUG-115803
Change-Id: Ibf2f049aacad925fea318c0ec490749e68e05b1d
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
(cherry picked from commit 446af298b0c00a419ff8e373e6b2917fd2af44eb)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Ahmad Samir 2023-08-09 16:38:55 +03:00 committed by Qt Cherry-pick Bot
parent e016960338
commit c013c57c84

View File

@ -2343,7 +2343,12 @@ void QMdiArea::showEvent(QShowEvent *showEvent)
}
if (!d->pendingPlacements.isEmpty()) {
foreach (QMdiSubWindow *window, d->pendingPlacements) {
// Nothing obvious in the loop body changes the container (in this code path)
// during iteration, this is calling into a non-const method that does change
// the container when called from other places. So take a copy anyway for good
// measure.
const auto copy = d->pendingPlacements;
for (QMdiSubWindow *window : copy) {
if (!window)
continue;
if (!window->testAttribute(Qt::WA_Resized)) {