Move docs for helpers from QtForeach to qforeach.qdoc

Task-number: QTBUG-106154
Change-Id: Icc2fbce4a96d18e9af880d4b0ee4a31cb360e5ed
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
Sona Kurazyan 2022-09-19 17:38:06 +02:00
parent f7bd53b2a6
commit 28ecb58d79
2 changed files with 76 additions and 71 deletions

View File

@ -0,0 +1,76 @@
// Copyright (C) 2022 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
/*!
\macro forever
\relates <QForeach>
This macro is provided for convenience for writing infinite
loops.
Example:
\snippet code/src_corelib_global_qglobal.cpp 31
It is equivalent to \c{for (;;)}.
If you're worried about namespace pollution, you can disable this
macro by adding the following line to your \c .pro file:
\snippet code/src_corelib_global_qglobal.cpp 32
If using other build systems, you can add \c QT_NO_KEYWORDS to the
list of pre-defined macros.
\sa Q_FOREVER
*/
/*!
\macro Q_FOREVER
\relates <QForeach>
Same as \l{forever}.
This macro is available even when \c no_keywords is specified
using the \c .pro file's \c CONFIG variable.
\sa foreach()
*/
/*!
\macro foreach(variable, container)
\relates <QForeach>
This macro is used to implement Qt's \c foreach loop. The \a
variable parameter is a variable name or variable definition; the
\a container parameter is a Qt container whose value type
corresponds to the type of the variable. See \l{The foreach
Keyword} for details.
If you're worried about namespace pollution, you can disable this
macro by adding the following line to your \c .pro file:
\snippet code/src_corelib_global_qglobal.cpp 33
\note Since Qt 5.7, the use of this macro is discouraged. It will
be removed in a future version of Qt. Please use C++11 range-for,
possibly with qAsConst(), as needed.
\sa qAsConst()
*/
/*!
\macro Q_FOREACH(variable, container)
\relates <QForeach>
Same as foreach(\a variable, \a container).
This macro is available even when \c no_keywords is specified
using the \c .pro file's \c CONFIG variable.
\note Since Qt 5.7, the use of this macro is discouraged. It will
be removed in a future version of Qt. Please use C++11 range-for,
possibly with qAsConst(), as needed.
\sa qAsConst()
*/

View File

@ -920,77 +920,6 @@ void qAbort()
// localtime() -- but not localtime_r(), which we use when threaded
// strftime() -- not used (except in tests)
/*!
\macro forever
\relates <QForeach>
This macro is provided for convenience for writing infinite
loops.
Example:
\snippet code/src_corelib_global_qglobal.cpp 31
It is equivalent to \c{for (;;)}.
If you're worried about namespace pollution, you can disable this
macro by adding the following line to your \c .pro file:
\snippet code/src_corelib_global_qglobal.cpp 32
\sa Q_FOREVER
*/
/*!
\macro Q_FOREVER
\relates <QForeach>
Same as \l{forever}.
This macro is available even when \c no_keywords is specified
using the \c .pro file's \c CONFIG variable.
\sa foreach()
*/
/*!
\macro foreach(variable, container)
\relates <QForeach>
This macro is used to implement Qt's \c foreach loop. The \a
variable parameter is a variable name or variable definition; the
\a container parameter is a Qt container whose value type
corresponds to the type of the variable. See \l{The foreach
Keyword} for details.
If you're worried about namespace pollution, you can disable this
macro by adding the following line to your \c .pro file:
\snippet code/src_corelib_global_qglobal.cpp 33
\note Since Qt 5.7, the use of this macro is discouraged. It will
be removed in a future version of Qt. Please use C++11 range-for,
possibly with qAsConst(), as needed.
\sa qAsConst()
*/
/*!
\macro Q_FOREACH(variable, container)
\relates <QForeach>
Same as foreach(\a variable, \a container).
This macro is available even when \c no_keywords is specified
using the \c .pro file's \c CONFIG variable.
\note Since Qt 5.7, the use of this macro is discouraged. It will
be removed in a future version of Qt. Please use C++11 range-for,
possibly with qAsConst(), as needed.
\sa qAsConst()
*/
/*!
\fn template <typename T> typename std::add_const<T>::type &qAsConst(T &t)
\relates <QtGlobal>