On Tuesday, 23 March 2021 06:25:09 PDT Matthew Woehlke wrote: > Why is QList removed? (I don't mean the *name* "QList", I mean the > container with indirect storage and reference stability. It's useful, > and unlike QHash, there is no STL equivalent available.)
Because everyone kept complaining that it was wrong. See Marc's blog[1] for detailed information. Aside from a very few narrow cases (the ones you likely want), it was the wrong container. It was occupying the most common container name in the API and because of that it was used everywhere. Quite a few of those APIs in Qt itself were stumbling in their use of QList and were in the not-optimal case. QList<int> was not optimal. QList<QVariant> (a.k.a. QVariantList) was not optimal. QList<QString> (the 3-pointers QString from Qt 6) would not have been optimal. So QList's implementation had to be replaced. The one in QVector was the one deemed "safest default for the majority of uses" so that's why QList == QVector in Qt 6. That left the question of whether we needed to provide a container that did what QList did: indirect, stable references. We concluded we did not, the use- cases were too few and far between to provide in the Qt API. But *adding* a new container is not difficult, if there's sufficient reason. [1] https://marcmutz.wordpress.com/2010/07/29/sneak-preview-qlist-considered-harmful/ -- Thiago Macieira - thiago.macieira (AT) intel.com Software Architect - Intel DPG Cloud Engineering _______________________________________________ Interest mailing list Interest@qt-project.org https://lists.qt-project.org/listinfo/interest