[Development] Another integer typedef OR how to prepare for 64-bit in Qt 5
lars.knoll at qt.io
Fri Nov 2 09:52:07 CET 2018
> On 2 Nov 2018, at 09:02, André Pönitz <apoenitz at t-online.de> wrote:
> On Thu, Nov 01, 2018 at 08:42:52PM -0700, Thiago Macieira wrote:
>> What do we do?
>> Option 1: do nothing, wait for Qt 6 and do the change then
>> Option 2: insert #if in our API, starting now
>> Option 3: use #if per class, starting now
>> Option 4: create a central #if and use this new type, starting now
> Option 5: Leave as-is, also in Qt 6.
> Known and bearable effort to handle the recurring 'why do you use
> int?' threads.
> No effort for existing users, which otherwise will face lots
> of size mismatch warnings in their code.
And the drawback, that people can’t use large data sets with our containers.
The size mismatch warnings users will get in Qt 6 are IMO not a huge issue. The narrowing to a smaller size does not break compatibility, as long as no container overflows in size (which it couldn’t with code based on Qt 5).
So my vote actually goes for option 4. We introduce a central type that’s int in Qt 5, qsizetype in Qt 6, and start using it. That allows us to introduce it then class by class and fix any issues we find around it.
More information about the Development