[Development] QString and related changes for Qt 6

Lars Knoll lars.knoll at qt.io
Wed May 13 08:18:21 CEST 2020



> On 12 May 2020, at 22:42, Thiago Macieira <thiago.macieira at intel.com> wrote:
> 
> 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.

Agreed as well. Those are two separate classes, but they can share the implementation of many methods.

Lars



More information about the Development mailing list