[Development] unified data model API in QtCore => thin wrapper proposal

Edward Welbourne edward.welbourne at qt.io
Fri Oct 5 13:25:05 CEST 2018


On Sunday, 9 September 2018 04:16:24 PDT Tor Arne Vestbø wrote:
>> This is exactly the kind of stuff I brought up at the contributors
>> summit.  We should strive to at least be on par with QJson, but I’m
>> hoping we can also have a nice API for writing (something QJson
>> doesn’t easily facilitate). Any chance the read-only stuff can be
>> added at least Thiago?

Thiago Macieira (9 September 2018 18:36) wrote:
> It can be, but we're already past feature freeze and I don't have time
> to do it right now. I'm completely swamped at work and I'm dedicating
> any free minutes I have for Qt to do code reviews for others.
>
> The issue with map["hello"] can be an API review issue, though.

For the sake of openness (we took most of this discussion off-line), the
end result of that was:

5.12:
QCbor{Map,Array}::operator[] grow over-loads for string literals and all
read-only variants return const QCborValue:
https://codereview.qt-project.org/240046

QCborArray::operator[] and insert() allow indices past the end of the
array, padding the array with invalid entries:
https://codereview.qt-project.org/240537

dev (5.13):
QCborValue{Ref,}::operator[] added where missing
https://codereview.qt-project.org/240042

The first's const-ing and the second's padding are needed in 5.12 to let
the last be backwards-compatible, when it lands.  Once the first two land,
we can finally close the qtbase API review.

	Eddy.



More information about the Development mailing list