[Development] Clang-based refactoring to Qt 6 (Proposal: Deprecate QVector in Qt 6)

Sérgio Martins sergio.martins at kdab.com
Thu Apr 23 21:22:53 CEST 2020

On 2020-04-23 14:55, Thiago Macieira wrote:
> On Thursday, 23 April 2020 05:25:33 PDT Vitaly Fanaskov wrote:
>> Provide clang-based tools to (semi-)automatically port users' code 
>> bases to
>> a new version of Qt. These tools might either fix a code or at least 
>> add a
>> comment in potentially problematic places where a user should correct 
>> the
>> code. A developer who changes API should also implement a rule for 
>> these
>> tools.
> This was discussed in a QtCS two or three years ago. There are two huge
> problems with that:
> 1) Clang cannot compile all Qt-using codebases. Therefore, its tooling 
> cannot
> work in all cases either.

This is less of a problem nowadays, where clang can even be a drop-in 
replacement for MSVC.
Embedded requires hacked mkspecs though (QNX for example).

> 2) No one has volunteered to write such conversion scripts.
> And a minor (3) is that automatic conversions seldom look nice and will
> require manual retouching anyway.

Specially when talking about QList -> QVector, as QVector doesn't 
guarantee the stability of references due to reallocation.

Tooling could still flag the places where you're taking references so 
you can do a manual verification though.

Sérgio Martins | sergio.martins at kdab.com | Senior Software Engineer
Klarälvdalens Datakonsult AB, a KDAB Group company
Tel: Sweden (HQ) +46-563-540090, USA +1-866-777-KDAB(5322)
KDAB - The Qt, C++ and OpenGL Experts

More information about the Development mailing list