[Development] Feature Freeze Exception: QStringView

André Somers andre at familiesomers.nl
Fri Feb 3 14:30:36 CET 2017



Op 03/02/2017 om 14:27 schreef Giuseppe D'Angelo:
> Il 03/02/2017 13:48, Kevin Kofler ha scritto:
>> We really need a plan to deprecate implicit casts between QString and ASCII.
>> They are not only the source of such inefficiencies from inexperienced or
>> lazy programmers, but also of encoding-related bugs. If you need to convert
>> between 8-bit encodings and QString, you should always use a function that
>> specifies the correct encoding for the context (e.g. fromLocal8Bit). If your
>> string is constant, you should use QStringLiteral.
> This is all stuff that we already have and that nobody uses because we
> fail at advertising it: QT_RESTRICTED_CAST_FROM_ASCII,
> QT_NO_CAST_FROM_ASCII, QT_ASCII_CAST_WARNINGS...
>
Perhaps it is time to flip the defaults then? Make ASCII cast stuff 
opt-in instead of opt-out? Anyway, off topic in this thread.

André



More information about the Development mailing list