QList::reserve is a member function of the Qt library class QList that reserves memory space for a specified number of elements in the list, improving the performance of subsequent append() and insert() operations.
Example 1: Reserving space for 100 integers in a QList of integers:
QList myIntList;
myIntList.reserve(100);
Example 2: Reserving space for 50 QStrings in a QList of QStrings:
QList myStringList;
myStringList.reserve(50);
The Qt library is a C++ GUI toolkit and application framework.
C++ (Cpp) QList::reserve - 30 examples found. These are the top rated real world C++ (Cpp) examples of QList::reserve extracted from open source projects. You can rate examples to help us improve the quality of examples.