From b8c32f5efc4ac2acf453fb8ecd4a72059abf678c Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Sun, 24 Jan 2016 03:11:48 +0100 Subject: [PATCH] [docs] Gently discourage use of Q_FOREACH/foreach ... and suggest to use C++11 range-for instead. Change-Id: If4d4dec1a0cbbc2307ee7d2635f0a8fc3a1ec353 Reviewed-by: Lars Knoll --- src/corelib/global/qglobal.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp index 408fff2886..1227445f1e 100644 --- a/src/corelib/global/qglobal.cpp +++ b/src/corelib/global/qglobal.cpp @@ -3540,7 +3540,11 @@ int qrand() \snippet code/src_corelib_global_qglobal.cpp 33 - \sa Q_FOREACH() + \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() */ /*! @@ -3552,7 +3556,11 @@ int qrand() This macro is available even when \c no_keywords is specified using the \c .pro file's \c CONFIG variable. - \sa foreach() + \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() */ /*!