[Development] QString and related changes for Qt 6

Thiago Macieira thiago.macieira at intel.com
Tue May 12 22:42:11 CEST 2020


On Tuesday, 12 May 2020 09:34:40 PDT Marc Mutz via Development wrote:
> On 2020-05-12 11:31, Jaroslaw Kobus wrote:
> > So, just an idea: instead of repeating the common API part in QString
> > and QStringView, what about making it one common? E.g. what about:
> > - deriving QString from QStringView (and adding mutator API)
> > or (maybe even better):
> > - aggregating QStringView object as a part of QString API and giving
> 
> > accesor for it, like:
> Vetoed. Over my dead body™. No inheriting of non-polymorphic types from
> each other. What we have is static polymorphism, and that's what we
> should continue to have.

Agreed, but also because many of the methods in QStringView are not applicable 
to QString.

QStringView::mid(), for example, returns QStringView, but QString::mid() 
returns QString.

QString is neither a specialisation nor a broadening of QStringView.

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel System Software Products





More information about the Development mailing list