Overte C++ Documentation
caption

Example of exposing a custom "managed" C++ QObject to JS The lifecycle of the created QObject* instance becomes managed by the invoking ScriptEngine – it will be automatically cleaned up once no longer reachable from any JS variables/closures. >access persistent settings stored in separate .json files var settings = JSAPIExample.getScopedSettings("example"); print("example settings stored in:", settings.fileName()); print("(before) example::timestamp", settings.getValue("timestamp")); settings.setValue("timestamp", Date.now()); print("(after) example::timestamp", settings.getValue("timestamp")); print("all example::* keys", settings.allKeys()); settings = null; // optional best pratice; allows the object to be reclaimed ASAP by the JS garbage collector