[Development] QList

André Somers andre at familiesomers.nl
Mon Mar 27 09:31:13 CEST 2017



Op 27/03/2017 om 09:22 schreef Martin Smith:
>
> > A vector is a collection of points and so is a polygon. Both
> are even ordered. 
>
>
> vector<point> is an ordered collection of points, but a QVector can
> contain anything; QVector<void*> can even contain unlike things, which
> is truly a tuple. So the problem here is the name QVector. The basic
> collection should be called QTuple or QArray, and QVector should mean
> QTuple<QPoint>.
>
Well, actually, QVector<void *> cannot contain unlike things. It can
contain only untyped pointers. Of course these can point to whatever you
want - unlike to what other pointers in the same QVector are pointing to
or not - but the pointers are still of the same type. Note that the
objects pointed to are also not contained in the QVector. They are
located somewhere else, not managed by the vector. So no, nothing like a
tuple at all.

André

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/development/attachments/20170327/628250e6/attachment.html>


More information about the Development mailing list