[Development] QList

Martin Smith Martin.Smith at qt.io
Sun Mar 26 10:50:17 CEST 2017


>A vector is a sequential collection of items. A polygon is a sequential

>collection of points. So a polygon can be a vector of points.


No, a vector is direction and a length. The name for a sequential collection of items is tuple.

________________________________
From: Development <development-bounces+martin.smith=qt.io at qt-project.org> on behalf of Thiago Macieira <thiago.macieira at intel.com>
Sent: Saturday, March 25, 2017 10:06:47 PM
To: development at qt-project.org
Subject: Re: [Development] QList

On sábado, 25 de março de 2017 12:08:09 PDT Giuseppe D'Angelo wrote:
> Il 25/03/2017 17:11, Martin Smith ha scritto:
> >>Note that I think we should change QPolygon to stop inheriting from
> >>
> > QVector in
> >
> >>the first place. QPolygon is not a QVector.
> >>
> > But then a vector is not a collection.
>
> So you're saying that since QPolygon is a collection (of points) and
> QVector is a collection (of anything), then a QPolygon is a QVector?

A vector is a sequential collection of items. A polygon is a sequential
collection of points. So a polygon can be a vector of points.

But I don't think that it should inherit, since some of the operations that
you can do in a vector don't really apply to a polygon. That's unlike QString/
QStringView where all operations apply, even if we have an override that
returns something differently.

> Humans are mammals, whales are mammals, therefore humans are whales?

:-)

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

_______________________________________________
Development mailing list
Development at qt-project.org
http://lists.qt-project.org/mailman/listinfo/development
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/development/attachments/20170326/1e02bfe4/attachment.html>


More information about the Development mailing list