diff --git a/src/corelib/tools/qlist.qdoc b/src/corelib/tools/qlist.qdoc index e1c917bbc4..f3b501a0e9 100644 --- a/src/corelib/tools/qlist.qdoc +++ b/src/corelib/tools/qlist.qdoc @@ -549,17 +549,14 @@ Removes all the elements from the list. - \note Until Qt 5.6, this also released the memory used by - the list. From Qt 5.7, the capacity is preserved. To shed - all capacity, swap with a default-constructed list: - \code - QList l ...; - QList().swap(l); - Q_ASSERT(l.capacity() == 0); - \endcode - or call squeeze(). + If this list is not shared, the capacity() is preserved. Use squeeze() to + shed excess capacity. - \sa squeeze() + \note In Qt versions prior to 5.7 (for QVector) and 6.0 (for QList), this + function released the memory used by the list instead of preserving the + capacity. + + \sa resize(), squeeze() */ /*! \fn template const T &QList::at(qsizetype i) const