[Development] HEADS UP: Don't use QList, use Q_DECLARE_TYPEINFO

Marc Mutz marc.mutz at kdab.com
Sun Jul 12 13:08:37 CEST 2015


On Sunday 12 July 2015 10:13:30 Smith Martin wrote:
> m trying to get information for updating the documentation for QList.

To me it looks like you're trying to argue about a very particular use of 
QList. At that level of details, it has no business being in the docs.

Better provide a benchmark into which users can easily plug their own types 
and that plots relative performance of various containers at various sizes. 
Then they can use that on their platform, on their type, with their access 
patterns to determine which container to choose.

> At
> the moment, it is misleading, judging by what you are saying. Maintaining
> the documentation isn't a red herring. It's actually my job.

If you want to update the docs, as a first approximation, write that QVector 
is _the_ default seqential (and, if it wasn't so awkward to use, also _the_ 
default associative) container (even though it's not currently reflected in 
the Qt API). All other containers (incl. QMap, QSet, ..., but maybe not QHash) 
should only be used after very careful profiling and QList should not be used 
by mere mortals at all.

That's a good stating point. From there, refinements can be made.

Thanks,
Marc

-- 
Marc Mutz <marc.mutz at kdab.com> | Senior Software Engineer
KDAB (Deutschland) GmbH & Co.KG, a KDAB Group Company
Tel: +49-30-521325470
KDAB - The Qt Experts



More information about the Development mailing list