Skip to content

Commit

Permalink
Doc: Remove "Container keywords" section from containers.html
Browse files Browse the repository at this point in the history
For foreach, we just mention that it is deprecated, and forever is not
actually directly related to Qt containers. Both macros are also
documented in qglobal.cpp, and the section title is not referenced
anywhere so this patch won't break any links.

Pick-to: 6.4
Change-Id: I6c3e11b205237e5b502173f2216606adf5812f55
Reviewed-by: Paul Wicking <[email protected]>
  • Loading branch information
kkoehne committed Aug 24, 2022
1 parent 836b2ae commit 4b3cb13
Showing 1 changed file with 1 addition and 23 deletions.
24 changes: 1 addition & 23 deletions src/corelib/doc/src/containers.qdoc
Original file line number Diff line number Diff line change
Expand Up @@ -333,28 +333,6 @@
on Java's iterator classes.
New code should should prefer \l{STL-Style Iterators}.

\section1 Container keywords

\target foreach
\section2 The foreach Keyword
\l{foreach-keyword}{The foreach keyword} is discouraged, new code should
prefer C++11 range-based loops.

\target forever
\section2 The forever keyword.
In addition to \c foreach, Qt also provides a \c forever
pseudo-keyword for infinite loops:

\snippet code/doc_src_containers.cpp 21

If you're worried about namespace pollution, you can disable
these macros by adding the following line to your \c .pro file:

\snippet code/doc_src_containers.cpp 22

\note The alternative macros Q_FOREACH and Q_FOREVER remain defined
regardless.

\section1 Qt containers compared with std containers

\table
Expand Down Expand Up @@ -410,7 +388,7 @@

Qt includes other template classes that resemble containers in
some respects. These classes don't provide iterators and cannot
be used with the \c foreach keyword.
be used with the \l foreach keyword.

\list
\li QCache<Key, T> provides a cache to store objects of a certain
Expand Down

0 comments on commit 4b3cb13

Please sign in to comment.