summaryrefslogtreecommitdiffstats
path: root/src/widgets/widgets/qmenubar.cpp
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@qt.io>2023-08-04 23:26:36 +0200
committerMarc Mutz <marc.mutz@qt.io>2023-08-09 09:38:48 +0200
commitc63c46037d21df19d15f51e37f2ef1d152109ba0 (patch)
tree9baacd4f31499cf2bdf5b35b9bd9526df1878b13 /src/widgets/widgets/qmenubar.cpp
parent8de746a96c4f83093d1bd50dc1bc3c68148097ac (diff)
Mark QtWidgets as free of Q_FOREACH, except where it isn't
The density of Q_FOREACH uses is high here, too high for this author to tackle in a short amount of time. But they're concentrated in just a few TUs, so pick a different strategy: Mark the whole library with QT_NO_FOREACH, to prevent new uses from creeping in, and whitelist the affected TUs by #undef'ing QT_NO_FOREACH locally, at the top of each file. For TUs that are part of a larger executable, this requires these files to be compiled separately, so add them to NO_PCH_SOURCES (which implies NO_UNITY_BUILD_SOURCES, too). Created QTBUG-115803 to keep track of this. Task-number: QTBUG-115803 Change-Id: Ib5d6192632d98bdcc6625a9a14e05d13bb7f759b Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Diffstat (limited to 'src/widgets/widgets/qmenubar.cpp')
-rw-r--r--src/widgets/widgets/qmenubar.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/widgets/widgets/qmenubar.cpp b/src/widgets/widgets/qmenubar.cpp
index a5c2c894a1..4487e2be30 100644
--- a/src/widgets/widgets/qmenubar.cpp
+++ b/src/widgets/widgets/qmenubar.cpp
@@ -1,6 +1,8 @@
// 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 <qmenubar.h>
#include <qstyle.h>