[Development] Proposal for an efficient and robust (de)serialization mechanism working with Qt-supported data
Arnaud Clere
arnaud.clere at minmaxmedical.com
Thu Aug 29 16:06:53 CEST 2019
Hi all,
I only received feedback from users in private, so I guess this is not the right mailing list to ask for feedback on new features... Would interest at qt-project.org be a better place?
I thought about the developers mailing list because my proposal may allow answering some needs expressed in the past on the mailing list:
1. "Is it possible to increase the max. document size for the JSON parser?"
https://lists.qt-project.org/pipermail/development/2019-August/036994.html
Not exactly on-topic but QBind being a function is not limited by RAM size and can read/write potentially infinite Json/Xml/... streams
2. "Maybe add some kind of accessible pipeline for QSettings serialization in Qt6?"
https://lists.qt-project.org/pipermail/development/2019-July/036894.html
QBind provides a lot of flexibility to read/write some C++ type to QSettings, Json, Cbor, Xml, and it could support databases through QSqlTableModel. It would also allow users to define less-used or even ad-hoc formats: YAML, HDF5...
Alternatively, IBind could be used internally by QSettings to enable more flexibility in the future while still supporting UserScope, etc.
3. "QVariant container API"
https://lists.qt-project.org/pipermail/development/2019-April/035535.html
QBind is able to convert numeric values that fit in the type presented by the user as well as convert to a string representation.
But it will not change numbers into bool or QChar as QVariant::convert does, and values that do not fit in the user type will be reported as ignored
~~~~~~~~~~~~~~~~~~
QVariantList vs; vs.append(123); vs.append(321);
QVector<double> ds; QStringList ls; QList<QChar> cs;
QVariantVisitor(&variantContainer).bind(ds); // ds == { 123.0, 321.0 }
QVariantVisitor(&variantContainer).bind(ls); // ls == { "123", "321" }
QVariantVisitor(&variantContainer) v; v.bind(cs); v.errors().size()==2; // cs = {}
~~~~~~~~~~~~~~~~~~
Please tell me how to proceed.
Cheers,
Arnaud
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/development/attachments/20190829/3e8fb635/attachment.html>
More information about the Development
mailing list