[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 13293d3308, which changed the
docs for clear().
Pick-to: 6.5 6.2
Fixes: QTBUG-112334
Change-Id: I457a1f699ddcdcdad2f1daf88f577007c136ee8f
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
bb10
parent
c69a5611ae
commit
58ebbb6220
|
|
@ -422,14 +422,19 @@
|
|||
*/
|
||||
|
||||
/*! \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
|
||||
current size, elements are added to the end; the new elements are
|
||||
initialized with a \l{default-constructed value}. If \a size is less
|
||||
than the current size, elements are removed from the end.
|
||||
|
||||
Since Qt 5.6, resize() doesn't shrink the capacity anymore.
|
||||
To shed excess capacity, use squeeze().
|
||||
If this list is not shared, the capacity() is preserved. 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()
|
||||
*/
|
||||
|
|
|
|||
Loading…
Reference in New Issue