January 2019
Intermediate to advanced
384 pages
11h 50m
English
As we already stated, Qt containers lack a feature equivalent to the std::Allocator, which can be used to customize memory allocations in containers. Thus, if we'd like to manage memory differently, we have to write custom data structure or just start using STL right away.
However, we have some control over the memory usage of the Qt containers, as many of them implement the capacity(), reserve(), and squeeze() methods, which can be used to query, preallocate, and decrease the memory held by containers.
At this point, this seems to be a good place to look at the growth strategies specific to Qt containers, as they are different from the standard library ones. As the Qt documentation states:
Read now
Unlock full access