From 6b361119ef413a229b95145ed3d3f51a7388a020 Mon Sep 17 00:00:00 2001 From: Mitch Curtis Date: Tue, 4 Mar 2025 14:50:54 +0800 Subject: [PATCH] Improve QList::move docs - State that both arguments must be within bounds. - Add example. Pick-to: 6.5 6.8 6.9 Change-Id: Ieba9c3469a2c8cf8c20d867abff5865d96c3ee6e Reviewed-by: Giuseppe D'Angelo --- src/corelib/tools/qlist.qdoc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/corelib/tools/qlist.qdoc b/src/corelib/tools/qlist.qdoc index b1b8ef6eed9..48822d31e3d 100644 --- a/src/corelib/tools/qlist.qdoc +++ b/src/corelib/tools/qlist.qdoc @@ -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 list = {1, 2, 3}; + list.move(0, list.size() - 1); + qDebug() << list; // Prints "QList(2, 3, 1)" + \endcode */ /*! \fn template void QList::removeFirst()