Mitch Curtis (29 October 2018 17:42)
> To solve #2, I first tried simply saving a QVariant containing a
> QByteArray (the contents of which were QDataStream's output). This
> didn't work because Qt's JSON implementation doesn't support
> QByteArray; it only supports QString. That is, calling
> QJsonObject::fromVariantMap(map) where "map" contains a QVariant
> containing a QByteArray will result in the corresponding JSON value
> being invalid/null.

I'm not sure where JSON got involved in that, but if you can manage to
use CBOR instead, it's just as happy with QByteArray as with QString
(and round-trips them to QByteArray, IIRC).  For details, see
qtbase/src/corelib/serialization/qcborstream.h

I've also no idea how well it plays with QSettings; hopefully you know
enough to work it out from the QCbor API ...

        Eddy.
_______________________________________________
Development mailing list
Development@qt-project.org
http://lists.qt-project.org/mailman/listinfo/development

Reply via email to