Skip to content

Commit 6b36111

Browse files
committed
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 <giuseppe.dangelo@kdab.com>
1 parent c0f9e99 commit 6b36111

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/corelib/tools/qlist.qdoc

+9
Original file line numberDiff line numberDiff line change
@@ -908,6 +908,15 @@
908908
\since 5.6
909909

910910
Moves the item at index position \a from to index position \a to.
911+
912+
\c from and \c to must be within bounds.
913+
914+
For example, to move the first item to the end of the list:
915+
\code
916+
QList<int> list = {1, 2, 3};
917+
list.move(0, list.size() - 1);
918+
qDebug() << list; // Prints "QList(2, 3, 1)"
919+
\endcode
911920
*/
912921

913922
/*! \fn template <typename T> void QList<T>::removeFirst()

0 commit comments

Comments
 (0)