本文整理汇总了C++中QScriptEngine::agent方法的典型用法代码示例。如果您正苦于以下问题:C++ QScriptEngine::agent方法的具体用法?C++ QScriptEngine::agent怎么用?C++ QScriptEngine::agent使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QScriptEngine
的用法示例。
在下文中一共展示了QScriptEngine::agent方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: detach
/*!
Detaches this backend from the current script engine.
The backend's state (including breakpoints and information on loaded
scripts) will be invalidated.
\sa attach()
*/
void QScriptDebuggerBackend::detach()
{
Q_D(QScriptDebuggerBackend);
if (d->agent) {
QScriptEngine *eng = d->agent->engine();
if (eng && eng->agent() == d->agent) {
eng->setAgent(0);
QScriptValue global = eng->globalObject();
global.setProperty(QString::fromLatin1("print"), d->origTraceFunction);
d->origTraceFunction = QScriptValue();
// global.setProperty(QString::fromLatin1("qAssert"), QScriptValue());
global.setProperty(QString::fromLatin1("__FILE__"), QScriptValue(),
QScriptValue::PropertyGetter);
global.setProperty(QString::fromLatin1("__FILE__"), d->origFileNameFunction);
d->origFileNameFunction = QScriptValue();
global.setProperty(QString::fromLatin1("__LINE__"), QScriptValue(),
QScriptValue::PropertyGetter);
global.setProperty(QString::fromLatin1("__LINE__"), d->origLineNumberFunction);
d->origLineNumberFunction = QScriptValue();
d->agent->nullifyBackendPointer();
d->agent = 0; // agent is owned by engine
}
}
d->pendingEvaluateLineNumber = -1;
d->ignoreExceptions = false;
d->nextScriptValueIteratorId = 0;
qDeleteAll(d->scriptValueIterators);
d->scriptValueIterators.clear();
qDeleteAll(d->scriptObjectSnapshots);
d->scriptObjectSnapshots.clear();
}