QWidget wgt;
QJSEngine js;
QLabel lbl(&wgt);
wgt.show();
QJSValue value = js.newQObject(&lbl);
js.globalObject().setProperty("lbl", value);
js.evaluate("document.cookie = \"user=John; path=/; expires=Tue, 19 Jan 2038 03:14:07 GMT\";");
js.evaluate("lbl.text = document.cookie;");
QWidget wgt;
QJSEngine js;
QLabel lbl(&wgt);
wgt.show();
QJSValue value = js.newQObject(&lbl);
js.globalObject().setProperty("lbl", value);
QJSValue js_object = js.newObject();
js.globalObject().setProperty("document", js_object);
js.evaluate("document.cookie = \"user=John; path=/; expires=Tue, 19 Jan 2038 03:14:07 GMT\";");
js.evaluate("lbl.text = document.cookie;");