On Aug 6, 2022, at 2:55 AM, Jaap Keuter <jaap.keuter@xxxxxxxxx> wrote:
> It uses QList::takeAt() to retrieve the value. But according to the documentation it does:
>
> T t = at(i);
> remove(i);
> return t;
>
>
> So it in fact removes the value from the list.
Yes - the documentation for QList::takeAt(), at
https://doc.qt.io/qt-5/qlist.html#takeAt
explicitly uses the word "removes":
Removes the item at index position i and returns it.
So, yes, unless the intent is to modify the list, use QList::at().