[Development] QVariantMap <-> QML

Gerhard Scheikl g.scheikl at avibit.com
Fri Jun 26 18:15:04 CEST 2015


Hausmann Simon <Simon.Hausmann at theqtcompany.com>, 14.06.2015 17:57:
> Hi,
> 
> This is a result of QVariant being a value type. If you make a copy and
> modify it, then the original remains as-is. The call to setContextProperty
> creates a copy. If you want explicitly shared data between the JavaScript
> environment and C++ then I would recommend using a JavaScript object -
> accessed from C++ as QJSValue, because those are explicitly shared.

Could you please give me a code sample for that approach?
I've tried it in many different ways without succeeding.
If i get to a depth >1 the change does not show up in C++.

Thanks.

Best regards
Gerhard



More information about the Development mailing list