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

Smith Martin Martin.Smith at theqtcompany.com
Fri Jul 10 13:27:26 CEST 2015


>I think the impedance mismatch here is that you use "list" to mean the same
>thing as "array" or "vector" (in STL terms, not mathematically) while I only
>use it to mean "linked list", in accordance with the STL.

I actually just mean it's a list, and I don't care how it is implemented. I can see that it makes a difference how it is implemented, depending on how it is used, but if the use is simply: 1) build the list once; 2) process the list once, and every time I add an element to the list I have to create it somewhere, I don't see why creating it on the heap is inefficient.

martin
________________________________________
From: development-bounces+martin.smith=theqtcompany.com at qt-project.org <development-bounces+martin.smith=theqtcompany.com at qt-project.org> on behalf of Marc Mutz <marc.mutz at kdab.com>
Sent: Friday, July 10, 2015 2:24 PM
To: development at qt-project.org
Subject: Re: [Development] HEADS UP: Don't use QList, use Q_DECLARE_TYPEINFO

On Friday 10 July 2015 12:32:45 Smith Martin wrote:
> Maybe it's just me, but I'm still not understanding your explanation, and I
> don't think you are answering my question:

I think the impedance mismatch here is that you use "list" to mean the same
thing as "array" or "vector" (in STL terms, not mathematically) while I only
use it to mean "linked list", in accordance with the STL.

That just goes to show how bad of an influence QList has. But it never hid its
design, and, indeed, the "default container" in Qt 3 was QValueList, which
actually *was* a doubly-linked list. Why Qt always nominates a list as the
default container while the STL recommends std::vector is one of the mysteries
to which only Trolls know the answer :)

--
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
_______________________________________________
Development mailing list
Development at qt-project.org
http://lists.qt-project.org/mailman/listinfo/development



More information about the Development mailing list