[Interest] The willy-nilly deletion of convenience, methods
Thiago Macieira
thiago.macieira at intel.com
Thu Mar 25 17:35:37 CET 2021
On Thursday, 25 March 2021 07:40:00 PDT Matthew Woehlke wrote:
> Wow, you *totally* misunderstood that.
>
> QList in Qt5 is mostly fine (and there's always QVector if needed).
>
> Qt 6 got rid of a useful container type.
I didn't misunderstand you. I'm disputing your assertions.
QList in Qt 5 was *not* mostly fine. It was mostly wrong and would have become
even more wrong in Qt 6. QStringList would have been wholly bad because
sizeof(QString) == 3 * sizeof(void*). And QList's design in trying to guess
what the best storage strategy was flawed, leading to silent binary
incompatibilities and possible data loss if you used Q_DECLARE_TYPEINFO to
make your type use QList efficiently.
But even flawed designs can have some uses, I agree. It's just not strong
enough to warrant being the default container type for Qt and being called
QList. The *name* had to be freed.
As I said, we can bring back the container, in a fixed form. It will most
definitely not have the hybrid model where it tries to guess which way is best
(that was the design flaw). If you want stability of references by way of
pointers, use this; if you don't care, use QList.
--
Thiago Macieira - thiago.macieira (AT) intel.com
Software Architect - Intel DPG Cloud Engineering
More information about the Interest
mailing list