Basic Qt containers

Most of the Qt containers are roughly equivalent to some STL containers, as shown in the next table:

Qt STL Qt STL
QVector std::vector QLinkedList std::list
QMap std::map QMultimap std::multimap
QHash std::unordered_map QMultiHash std::unordered_multimap
QSet std::unordered_set QVariant std::any

The implementation of the basic containers is similar to that of the standard library: QLinkedList is a doubly linked list, QMap is a red-black tree (although in Qt 4 it used a skip-list implementation), QHash uses bucket chaining, and QVector uses a double-the-space reallocation strategy. The difference is that they are all implicitly shared. Another difference is their comparatively limited functionality, having ...

Get Hands-On High Performance Programming with Qt 5 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.