[Development] QList

Thiago Macieira thiago.macieira at intel.com
Mon Mar 27 22:54:16 CEST 2017


On segunda-feira, 27 de março de 2017 12:19:38 PDT Scott Aron Bloom wrote:
> My two bits, as a 15+ year Qt professional level user, and semi-active
> qt-list person, who is on this list to see whats going on, but doesn’t have
> much time to actively develop... Sometimes called a whiner 😊
 
> Calling it a "List" is wrong...it does imply linked list... If you wanted to
> have two "vectors" of different levels of optimization, QArray and QVector
> would have been my preference.

Well, of the 5 Qt major versions, none of them had "list implies linked list". 
Qt2 and 3 had a linked list called QValueList, but Qt2's class called QList 
was something worse: it was a linked list of pointers to the object. That 
became QPtrList in Qt 3, which freed up the name to make QList in Qt4 that 
inherited the original Qt behaviour of pointer to the object, but dropped the 
linked part.

Since QList is the most commonly used container in Qt, we couldn't keep it as 
a linked list.

If you want a linked list, there's QLinkedList.
 
> As somone who lived through the Qt 3->4 pain, (and who as a consultant
> helped 30+ projects do the conversion), it was painful.  But not because of
> the naming, mostly because of lost functionality that didn’t exist until
> Graphics View came back  To be honest, I forget which "view" Qt3 used that
> had to wait until Qt4's QGraphicsView was of full quality.

That was QCanvas (Q3Canvas).
 
> If it were up to me.. I would love to see Qt focus on containers that Qt
> MUST have that add SIGNIFICANT value to the Qt world, NOT "well when we
> started, there was no stl" version.  For instance, I do see the value of
> QString for translation in the Qt world.  Others may disagree, but QList
> std::list or std::vector, or QSet, makes NO sense to me for Qt to keep.

The argument isn't about there being an alternative, it's that the alternative 
isn't suitable because it's easy to get wrong.
 
-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center




More information about the Development mailing list