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.
Share my state between different scripts
Moderator: andrew
Forum rules
Always indicate your operating system and QCAD version.
Attach drawing files, scripts and screenshots.
Post one question per topic.
Always indicate your operating system and QCAD version.
Attach drawing files, scripts and screenshots.
Post one question per topic.
Re: Share my state between different scripts
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"];