[Interest] QJsonDocument::fromVariant failing with list
Allan Sandfeld Jensen
kde at carewolf.com
Wed Jun 9 09:34:40 CEST 2021
On Dienstag, 8. Juni 2021 23:47:50 CEST Thiago Macieira wrote:
> On Tuesday, 8 June 2021 13:57:53 PDT Jason H wrote:
> > Which is neiher what I acually had but performs the same bad conversion as
> > what I had. I am not sure why the QVariantList vs QList have different
> > fidelity - the one with more fidelity - QList - actually has has less
> > specificity.
> Because that's how C++ works.
> QList is not a type, it's a template. Neither QVariant nor QJsonDocument can
> know all possible QList instantiations. So they have coded only a few
> (QVariantList and QStringList only, possibly QVector<QVariant> and
> QVector<QString> in Qt 5 too, I don't remember).
I guess our system could detect QList<QVariant> as QVariantList and
QList<QString> as QStringList. They should be binary identical anyway.
More information about the Interest