1// Copyright (C) 2022 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
8 This macro is provided for convenience for writing infinite
13 \snippet code/src_corelib_global_qglobal.cpp 31
15 It is equivalent to \c{for (;;)}.
17 If you're worried about namespace pollution, you can disable this
18 macro by adding the following line to your \c .pro file:
20 \snippet code/src_corelib_global_qglobal.cpp 32
22 If using other build systems, you can add \c QT_NO_KEYWORDS to the
23 list of pre-defined macros.
34 This macro is available even when \c no_keywords is specified
35 using the \c .pro file's \c CONFIG variable.
41 \macro foreach(variable, container)
44 This macro is used to implement Qt's \c foreach loop. The \a
45 variable parameter is a variable name or variable definition; the
46 \a container parameter is a Qt container whose value type
47 corresponds to the type of the variable. See \l{The foreach
50 If you're worried about namespace pollution, you can disable this
51 macro by adding the following line to your \c .pro file:
53 \snippet code/src_corelib_global_qglobal.cpp 33
55 \note Since Qt 5.7, the use of this macro is discouraged.
56 Use C++11 range-based \c for, possibly with \c {std::as_const()},
61 \macro Q_FOREACH(variable, container)
64 Same as foreach(\a variable, \a container).
66 This macro is available even when \c no_keywords is specified
67 using the \c .pro file's \c CONFIG variable.
69 \note Since Qt 5.7, the use of this macro is discouraged.
70 Use C++11 range-based \c for, possibly with \c {std::as_const()},