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

Thiago Macieira thiago.macieira at intel.com
Sun Sep 9 18:34:51 CEST 2018


On Sunday, 9 September 2018 03:25:54 PDT Sze Howe Koh wrote:
> Hi Thiago,
> > 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

That's what you get for trying to make a modern API that uses QLatin1String 
and QStringView... But then I changed to QString.

>     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?

Needs investigation. I had QStringView originally, but had to change for some 
reason.

> 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

That's what I said in the previous email. When I asked for someone to "give it 
a go", I meant adding the necessary API to make it work.

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center






More information about the Development mailing list