[Development] QList

André Pönitz apoenitz at t-online.de
Sat Mar 18 20:42:00 CET 2017


On Sat, Mar 18, 2017 at 08:04:46PM +0100, Kevin Kofler wrote:
> Thiago Macieira wrote:
> > A lot. I don't think we can have Qt 6 without a class called "QList". But
> > we can make it be the same as QVector, which is what we want people to
> > use.
> 
> So the user code will at least compile (unlike with Marc Mutz's approach), 

That would be pretty much my minimum requirement, i.e. to have *something*
that is called 'QList', has most of QList's current interface, and at least
(amortized) O(1) append and at() guarantees. 

> but algorithms that previously completed in O(n) will now complete only in 
> O(mn) (and of course this multiplies on: if you were inserting into a QList 
> in a loop, it goes from O(n²) to O(mn²)), which is kinda ironic for a change 
> designed to "improve performance".

To be fair, Marc wants to kill QList, not replace it with something that
has worse complexity in some cases. The irony here is due to people like
you and I who insist on keeping their code compilable.

Anyway, there could be a warning when using parts from Qt6's QList interface
that have a worse complexity than Qt5's list.

Andre'



More information about the Development mailing list