尝试以子类QObject作为参数执行小脚本。QJSEnginejsEngine;QJSValuearg=jsEngine.newQObject(child);//Childit'ssubclassedQObjectQJSValuefunction=jsEngine.evaluate(m_childRestriction);QJSValueresult=function.call(QJSValueList()在销毁jsEngine时,它为我的子对象调用delete(因为newQObject使用JavaScriptOwnership创建它)。如何避免它,如何更改arg的所有权?脚本很简