本文整理汇总了C++中actiontools::ActionInstance::clearRuntimeParameters方法的典型用法代码示例。如果您正苦于以下问题:C++ ActionInstance::clearRuntimeParameters方法的具体用法?C++ ActionInstance::clearRuntimeParameters怎么用?C++ ActionInstance::clearRuntimeParameters使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类actiontools::ActionInstance
的用法示例。
在下文中一共展示了ActionInstance::clearRuntimeParameters方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: startExecution
bool Executer::startExecution(bool onlySelection)
{
Q_ASSERT(mScriptAgent);
Q_ASSERT(mScriptEngine);
#ifdef ACT_PROFILE
Tools::HighResolutionTimer timer("Executer::startExecution");
#endif
Code::CodeTools::addClassToScriptEngine<CodeActiona>("Actiona", mScriptEngine);
CodeActiona::setActExec(mIsActExec);
CodeActiona::setActionaVersion(mActionaVersion);
CodeActiona::setScriptVersion(mScriptVersion);
Code::CodeTools::addClassGlobalFunctionToScriptEngine("Actiona", &CodeActiona::version, "version", mScriptEngine);
Code::CodeTools::addClassGlobalFunctionToScriptEngine("Actiona", &CodeActiona::scriptVersion, "scriptVersion", mScriptEngine);
Code::CodeTools::addClassGlobalFunctionToScriptEngine("Actiona", &CodeActiona::isActExec, "isActExec", mScriptEngine);
Code::CodeTools::addClassGlobalFunctionToScriptEngine("Actiona", &CodeActiona::isActiona, "isActiona", mScriptEngine);
mScriptAgent->setContext(ScriptAgent::ActionInit);
CodeInitializer::initialize(mScriptEngine, mScriptAgent, mActionFactory);
mScriptAgent->setContext(ScriptAgent::Parameters);
QScriptValue script = mScriptEngine->newObject();
mScriptEngine->globalObject().setProperty("Script", script, QScriptValue::ReadOnly);
script.setProperty("nextLine", 1);
script.setProperty("line", 1, QScriptValue::ReadOnly);
QScriptValue callProcedureFun = mScriptEngine->newFunction(callProcedureFunction);
callProcedureFun.setData(mScriptEngine->newQObject(this));
script.setProperty("callProcedure", callProcedureFun);
QScriptValue console = mScriptEngine->newObject();
mScriptEngine->globalObject().setProperty("Console", console, QScriptValue::ReadOnly);
QScriptValue function = mScriptEngine->newFunction(printFunction);
function.setData(mScriptEngine->newQObject(this));
console.setProperty("print", function);
function = mScriptEngine->newFunction(printWarningFunction);
function.setData(mScriptEngine->newQObject(this));
console.setProperty("printWarning", function);
function = mScriptEngine->newFunction(printErrorFunction);
function.setData(mScriptEngine->newQObject(this));
console.setProperty("printError", function);
function = mScriptEngine->newFunction(clearConsoleFunction);
function.setData(mScriptEngine->newQObject(this));
console.setProperty("clear", function);
mExecuteOnlySelection = onlySelection;
mCurrentActionIndex = 0;
mActiveActionsCount = 0;
mExecutionPaused = false;
bool initSucceeded = true;
int lastBeginProcedure = -1;
mScript->clearProcedures();
mScript->clearCallStack();
const QHash<QString, ActionTools::Resource> &resources = mScript->resources();
for(const QString &key: resources.keys())
{
const ActionTools::Resource &resource = resources.value(key);
QScriptValue value;
switch(resource.type())
{
case ActionTools::Resource::BinaryType:
case ActionTools::Resource::TypeCount:
value = Code::RawData::constructor(resource.data(), mScriptEngine);
break;
case ActionTools::Resource::TextType:
value = QString::fromUtf8(resource.data(), resource.data().size());
break;
case ActionTools::Resource::ImageType:
{
QImage image;
if(!image.loadFromData(resource.data()))
{
mConsoleWidget->addResourceLine(tr("Invalid image resource"), key, ActionTools::ConsoleWidget::Error);
return false;
}
value = Code::Image::constructor(image, mScriptEngine);
}
break;
}
mScriptEngine->globalObject().setProperty(key, value, QScriptValue::ReadOnly | QScriptValue::Undeletable);
}
for(int actionIndex = 0; actionIndex < mScript->actionCount(); ++actionIndex)
{
ActionTools::ActionInstance *actionInstance = mScript->actionAt(actionIndex);
actionInstance->reset();
actionInstance->clearRuntimeParameters();
actionInstance->setupExecution(mScriptEngine, mScript, actionIndex);
//.........这里部分代码省略.........