[Development] QtCS2019 Notes: QtCore

Uwe Rathmann Uwe.Rathmann at tigertal.de
Sun Nov 24 10:44:52 CET 2019

On 11/23/19 11:26 PM, Thiago Macieira wrote:

>> Wrapping int() around requires more manual work.
> I understand, but I think this is the type of change that will eventually
> become a problem down the road. We think it can help with porting, but it may
> later introduce subtle bugs by truncating sizes.

Something that is very common in application code is, that you have some 
sort of index, where -1 is used to indicate that the index is not valid, 
f.e QVector::indexOf

Statements where you compare an index with the size happen often and 
when they don't have the same data type it is not a temporary migration 
problem - it is a regression in terms of convenience.

I fully agree with André - having 2 different APIs makes a lot of sense 
to me. But instead of using count/size I would use something like 
countU/sizeU. like you have QPen::widthF and QPen::width.

My 2 cents,

More information about the Development mailing list