[Development] QString and related changes for Qt 6

Marc Mutz marc.mutz at kdab.com
Thu May 14 15:28:40 CEST 2020


On 2020-05-13 20:48, Jaroslaw Kobus wrote:
>> From: Development <development-bounces at qt-project.org> on behalf of 
>> Thiago Macieira <thiago.macieira at intel.com>
>> Sent: Wednesday, May 13, 2020 6:21 PM
>> To: development at qt-project.org
>> Subject: Re: [Development] QString and related changes for Qt 6
>> 
>> On terça-feira, 12 de maio de 2020 22:57:31 PDT Jaroslaw Kobus wrote:
>> > That's why I've mentioned the better option: aggregation: QStringView could
>> > be a member of QString. However, the downside would be that every time you
>> > want to call a const method for QString, you would need to first get access
>> > to the QStringView member. The advantage is that in this way you may easily
>> > integrate different interfaces inside one class.
>> 
>> This is more or less what we want to do. QString in Qt 6 is {begin, 
>> size, d}
>> and QStringView has always been {begin, size}. So, yeah, it can be 
>> done.
>> 
>> The idea is indeed to offload the majority of the non-mutating methods 
>> to the
>> same functions, from inline code. There's no reason to have both
>> QString::indexOf and QStringView::indexOf entry points in the library.
> 
> Good to hear. And I hope that Marc will resurrect soon after his veto.

Had you looked into qstring.cpp (I know it hurts!), you'd've seen that 
it's already implemented that way. But Neither does QString aggregate a 
QStringView nor does it inherit it.

So, there's no resurrection coming because no death was caused.

Thanks,
Marc


More information about the Development mailing list