Details
-
Bug
-
Resolution: Done
-
P2: Important
-
None
-
6.0
-
None
Description
In
https://doc-snapshots.qt.io/qt6-dev/qt5-qlinkedlist.html
you can read at
https://doc-snapshots.qt.io/qt6-dev/qt5-qlinkedlist.html#details
QList<T>, QLinkedList<T>, and QVector<T> provide similar functionality. Here's an overview:
- For most purposes, QList is the right class to use. Its index-based API is more convenient than QLinkedList's iterator-based API, and it is usually faster than QVector because of the way it stores its items in memory (see Algorithmic Complexity for details). It also expands to less code in your executable.
- If you need a real linked list, with guarantees of constant time insertions in the middle of the list and iterators to items rather than indexes, use QLinkedList.
- If you want the items to occupy adjacent memory positions, use QVector.
As QList is implemented as QVector internally this documentation is not up to date.
Attachments
Issue Links
- relates to
-
QTBUG-86584 Update Qt Core Container Classes Overview page
- Closed