[docs] QList: fix history of resize(n) semantics change

The description was copied from QVector, and doesn't exactly fit
QList. For QList, the function is \since 6.0 when QList became
QVector, not in Qt 5.7, as indicated.

Be more precise.

Amends 13293d3308c04d22bc2928e8991f47744560e085, which changed the
docs for clear().

Fixes: QTBUG-112334
Change-Id: I457a1f699ddcdcdad2f1daf88f577007c136ee8f
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit 58ebbb62203ec31e03d3ee0bc58c57de5b3bcce4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Marc Mutz 2022-11-02 17:06:22 +01:00 committed by Qt Cherry-pick Bot
parent 7eb8a71c94
commit ae6ec20349

View File

@ -422,14 +422,19 @@
*/ */
/*! \fn template <typename T> void QList<T>::resize(qsizetype size) /*! \fn template <typename T> void QList<T>::resize(qsizetype size)
\since 6.0
Sets the size of the list to \a size. If \a size is greater than the Sets the size of the list to \a size. If \a size is greater than the
current size, elements are added to the end; the new elements are current size, elements are added to the end; the new elements are
initialized with a \l{default-constructed value}. If \a size is less initialized with a \l{default-constructed value}. If \a size is less
than the current size, elements are removed from the end. than the current size, elements are removed from the end.
Since Qt 5.6, resize() doesn't shrink the capacity anymore. If this list is not shared, the capacity() is preserved. Use squeeze()
To shed excess capacity, use squeeze(). to shed excess capacity.
\note In Qt versions prior to 5.7 (for QVector; QList lacked a resize()
until 6.0), this function released the memory used by the list instead of
preserving the capacity.
\sa size() \sa size()
*/ */