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

Popular posts from this blog

sequelize.js - Sequelize group by with association includes id -

android - Robolectric "INTERNET permission is required" -

java - Android raising EPERM (Operation not permitted) when attempting to send UDP packet after network connection -