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

Sze Howe Koh szehowe.koh at gmail.com
Sun Sep 9 12:25:54 CEST 2018


Hi Thiago,

On Sat, 18 Aug 2018 at 01:51, Thiago Macieira <thiago.macieira at intel.com> wrote:
>
> On Friday, 17 August 2018 08:13:21 PDT Tor Arne Vestbø wrote:
> > > Now, looking at the code, I don't think it does work. I thought that
> > > QCborValue::operator[] returned QCborValueRefs, but it doesn't. Adding a
> > > set of non-const overloads returning QCborValueRef might be the trick.
> > That would be great to have as part of the API yes
>
> I won't have time to experiment with it before feature freeze. Technically,
> the API freeze doesn't happen until Beta, so we have a few more weeks, but I
> wouldn't hold my hopes up that I will have time to trial this.
>
> Any chance you can give it a go? Or someone else?

I've installed the Qt 5.12 alpha for MSVC 2015 and started playing
with the CBOR API.

    map["hello"] = foo; // ERROR C2593: Operator '[' is ambiguous
    map[QString("hello")] = foo; // OK

The ambiguity disappears if I remove either operator[](const QString&)
OR operator[](const QCborValue&). Oddly, operator[](QLatin1String)
doesn't matter. Why's that?

Also, chained operator[] currently doesn't work because
QCborValueRef::operator[](...) doesn't exist:

    qDebug() << array[1]; // OK
    qDebug() << array[1][2]; // ERROR C2676: 'QCborValueRef' does not
define this operator or a conversion to a type acceptable to the
predefined operator


Regards,
Sze-Howe



More information about the Development mailing list