I was having this issue as well. A related thread addresses it perfectly. You just need to tweak the context a bit before you call evaluate:
Qt Code:
QScriptContext *context = engine->currentContext(); QScriptContext *parent=context->parentContext(); if(parent!=0) { context->setActivationObject(context->parentContext()->activationObject()); context->setThisObject(context->parentContext()->thisObject()); }To copy to clipboard, switch view to plain text mode
Original thread: http://www.qtcentre.org/threads/2043...pt-from-script
Bookmarks