[Interest] QJsonDocument::fromVariant failing with list

Thiago Macieira thiago.macieira at intel.com
Wed Jun 9 16:48:39 CEST 2021


On Wednesday, 9 June 2021 07:28:08 PDT Jason H wrote:
> One hack I would workfor me is a new class, QVariantMapList, (List of
> QVariantMaps) which is really all I need at the moment, unless there'd be a
> need for QVariantListList too? (That's a terrible name though)
> 
> Ultimately, I just want to express JSON as closely as I can in C++.
> Ideally:
> QVariantMap map {
> {"err", QVariant()},
> {"letters", QVariantMapList {
> {{"a",1}},
> {{"b",2}},
> {{"c",3}}
> }}
> };

Stop using QVariantMapList. You want a QVariantMap.

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel DPG Cloud Engineering





More information about the Interest mailing list