[Development] QtCS2019 Notes: QtCore

Thiago Macieira thiago.macieira at intel.com
Sat Nov 23 02:11:29 CET 2019


On Friday, 22 November 2019 20:01:30 CET Giuseppe D'Angelo via Development 
wrote:
> Il 22/11/19 18:49, Thiago Macieira ha scritto:
> > We decided not to add q6sizetype. Just add a "### Qt6: qsizetype" comment
> > where you can't use qsizetype in Qt 6. We'll deal with conflicts.
> 
> Sorry, what do you mean by "conflicts"? I mean that there's countless
> code today that uses "int s = foo.size()" (or indexOf, or similar); such
> code will now trigger narrowing warnings.

Fix it in Qt 6.

If you write new code in Qt 5 that you know will cause Qt 6 warnings, leave 
the ### comment so that you or someone else can fix it for that branch after 
it merges.

> > There's always QVector<T>::size_type, QByteArray::size_type and
> > QString::size_type if you really need to be explicit and that's fine
> > today.
> 
> The chance that non-generic code uses this is practically 0 and we know
> it. Yes, "auto" will work, but still has anyone actually did the
> exercise on a big codebase (Creator, KDE, ...) and checked how many
> warnings are we talking about?

No, no one has checked how many warnings it'll produce. I don't see how that's 
relevant though: we will change the size types.

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel System Software Products





More information about the Development mailing list