[Development] QList

Thiago Macieira thiago.macieira at intel.com
Sat Mar 25 22:06:47 CET 2017


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




More information about the Development mailing list