Improve QList::move docs

- State that both arguments must be within bounds.
- Add example.

Pick-to: 6.8 6.5
Change-Id: Ieba9c3469a2c8cf8c20d867abff5865d96c3ee6e
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
(cherry picked from commit 6b361119ef413a229b95145ed3d3f51a7388a020)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Mitch Curtis 2025-03-04 14:50:54 +08:00 committed by Qt Cherry-pick Bot
parent f45d0214f9
commit c785ab7a62

View File

@ -908,6 +908,15 @@
\since 5.6
Moves the item at index position \a from to index position \a to.
\c from and \c to must be within bounds.
For example, to move the first item to the end of the list:
\code
QList<int> list = {1, 2, 3};
list.move(0, list.size() - 1);
qDebug() << list; // Prints "QList(2, 3, 1)"
\endcode
*/
/*! \fn template <typename T> void QList<T>::removeFirst()