[Interest] How to change nested JSON object directly

Dmitry Volosnykh dmitry.volosnykh at gmail.com
Thu Jan 12 01:50:05 CET 2017


This issue has been addressed here: QTBUG-25723

On Thu, Jan 12, 2017 at 2:14 AM jack ma <assangema at gmail.com> wrote:

> Hi,
> I mean if we can don't copy a QJsonObject with toObject(), but like
> something pointer, to change the nested value directly.
> because my nested object may be to big, that may waste memory and time.
>
> 2017-01-12 6:56 GMT+08:00 Thiago Macieira <thiago.macieira at intel.com>:
>
> On quinta-feira, 12 de janeiro de 2017 06:09:23 PST jack ma wrote:
> > *jsonObject["key1"].toObject().value("key2") = "somteting2"*
> >
> >
> > but now , *toObect()* just return a copy of key1, so you can't change
> > key2 directly
>
> QJsonObject jso2 = jsonObject["key1"].toObject();
> jso2["key2"] = "something2";
> jsonObject["key1"] = jso2;
>
> --
> Thiago Macieira - thiago.macieira (AT) intel.com
>   Software Architect - Intel Open Source Technology Center
>
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest
>
>
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20170112/820ce94f/attachment.html>


More information about the Interest mailing list