[Interest] why does Qt prefer to return QList over QVector?

Thiago Macieira thiago.macieira at intel.com
Tue Jan 27 11:24:43 CET 2015


On Tuesday 27 January 2015 10:34:57 Giuseppe D'Angelo wrote:
> I don't think it has ever been faster. The main reason behind QList is 
> to generate less code: all the handling of the backing array is shared 
> amongst the specializations. But please refer to Marc Mutz's awesome 
> blog posts for more info:
> 
> https://marcmutz.wordpress.com/effective-qt/containers/

I was going to rewrite QList with QVector for Qt 5.0 but didn't have enough 
time before feature freeze.

> The other difference with QVector is that QList has a prepend optimization.

And this was one of the reasons.

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center




More information about the Interest mailing list