diff options
author | Marc Mutz <marc.mutz@kdab.com> | 2016-01-24 03:11:48 +0100 |
---|---|---|
committer | Marc Mutz <marc.mutz@kdab.com> | 2016-01-26 11:20:51 +0000 |
commit | b8c32f5efc4ac2acf453fb8ecd4a72059abf678c (patch) | |
tree | 2d9a48ac65e5f433e0bb283aa91271aed73da76f /src/corelib/global | |
parent | 520afea6b7f1cb89eda0c6a773ef545991f3f4c2 (diff) |
[docs] Gently discourage use of Q_FOREACH/foreach
... and suggest to use C++11 range-for instead.
Change-Id: If4d4dec1a0cbbc2307ee7d2635f0a8fc3a1ec353
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
Diffstat (limited to 'src/corelib/global')
-rw-r--r-- | src/corelib/global/qglobal.cpp | 12 |
1 files 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() */ /*! |