[Development] [RFO QTBUG-84739] QJsonValue::fromVariant containing QByteArray

Tor Arne Vestbø Tor.arne.Vestbo at qt.io
Fri Jul 3 00:46:24 CEST 2020



> On 2 Jul 2020, at 19:07, Thiago Macieira <thiago.macieira at intel.com> wrote:
> 
> On Thursday, 2 July 2020 03:57:08 PDT Tor Arne Vestbø wrote:
>> Which does not match the documented behavior, so I think a revert makes
>> sense to avoid the surprising behavior change.
> 
> Thanks for the opinion, Tor Arne. For the record, revert permanently or revert 
> only in 5.15?

I think I prefer permanently, and then clearly documenting that the fallback conversion to a string for non-listed types may be lossy, teaching the user to either encode the data into one of the well defined and non-lossy types (e.g. use a QString if what you're representing is a string, or base64-encode raw binary data), or use CBOR instead.

That leaves less amount of surprises when upgrading to Qt 6 while being clear about the possible downsides.

Cheers,
Tor Arne



More information about the Development mailing list