From 4bfe6ea25136b49a982f7fe47b1b788524a5db2e Mon Sep 17 00:00:00 2001 From: Ahmad Samir Date: Wed, 11 Oct 2023 19:50:11 +0300 Subject: QWidgetRepaintManager: port Q_FOREACH to ranged-for The loop body doesn't change the QHash, so use asKeyValueRange() and ranged-for. Un-blacklist the file, by removing "#undef QT_NO_FOREACH", and removing the source file from NO_PCH_SOURCES. Task-number: QTBUG-115803 Change-Id: I22924d2addeed75867edf9f6cac53f1c6f266dcc Reviewed-by: Marc Mutz Reviewed-by: Christian Ehrlicher --- src/widgets/kernel/qwidgetrepaintmanager.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src/widgets/kernel') diff --git a/src/widgets/kernel/qwidgetrepaintmanager.cpp b/src/widgets/kernel/qwidgetrepaintmanager.cpp index ab3caafaa9..c63f745446 100644 --- a/src/widgets/kernel/qwidgetrepaintmanager.cpp +++ b/src/widgets/kernel/qwidgetrepaintmanager.cpp @@ -1,8 +1,6 @@ // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only -#undef QT_NO_FOREACH // this file contains unported legacy Q_FOREACH uses - #include "qplatformdefs.h" #include "qwidgetrepaintmanager_p.h" @@ -50,7 +48,7 @@ public: } bool isLocked() const { - foreach (bool v, m_locked) { + for (const auto &[_, v] : m_locked.asKeyValueRange()) { if (v) return true; } -- cgit v1.2.3