QVector is fine. If you know the number of points before you start you can call QVector::resize() once only. You incur only a single memory allocation and construction, rather than multiples as you grow the vector. Access is then random and does not involve memory reallocations.
If you have an idea of the maximum size then call reserve() once and grow the vector only by appending. This avoids memory reallocations.
If you are inserting in the middle then QVector is not right for you (or your algorithm should be rethought).
Bookmarks