Page 1 of 1

Share my state between different scripts

Posted: Fri Mar 16, 2018 12:46 pm
by sarlaa
Hi,

Could you tell me how can I share my state, that contains data related to document with format json, with all scripts as data global ?

I saw this reference viewtopic.php?f=30&t=3187&p=11338&hilit ... ble#p11338
but it seems that works just for primitifs type variables.

Regards.

Re: Share my state between different scripts

Posted: Fri Mar 16, 2018 2:04 pm
by andrew
The approach for application wide, non-persistent data should work fine also for JSON:

Code: Select all

var appWin = RMainWindowQt.getMainWindow();
appWin.setProperty("MyProperty", {"a":3, "b":7, ...});

var value = appWin.property("MyProperty")["a"];