c++ - Migration from QScriptEngine to QJSEngine -
i'm migrating qscriptengine code on qjsengine. now, have:
class pars { public: static qscriptvalue printmainlog(qscriptcontext* c, qscriptengine* e); }; qscriptvalue pars::printmainlog(qscriptcontext* c, qscriptengine* e) { //some actions return e->globalobject().property(""); } ... qscriptengine engine; ... engine.globalobject().setproperty("printlog",engine.newfunction(pars::printmainlog));
so, user can put printlog("what ever"); in application in , example, qlineedit , function pars::printmainlog evalute.
is there way qjsengine? so, user put same printlog("what ever");? way find here, user should put logger.printlog("what ever"); logger class inherited qobject printlog slot.
Comments
Post a Comment