本文整理汇总了C++中QScriptEngineDebugger::state方法的典型用法代码示例。如果您正苦于以下问题:C++ QScriptEngineDebugger::state方法的具体用法?C++ QScriptEngineDebugger::state怎么用?C++ QScriptEngineDebugger::state使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QScriptEngineDebugger
的用法示例。
在下文中一共展示了QScriptEngineDebugger::state方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: attachAndDetach
void tst_QScriptEngineDebugger::attachAndDetach()
{
#if defined(Q_OS_WINCE) && _WIN32_WCE < 0x600
QSKIP("skipped due to high mem usage until task 261062 is fixed", SkipAll);
#endif
{
QScriptEngineDebugger debugger;
QCOMPARE(debugger.state(), QScriptEngineDebugger::SuspendedState);
debugger.attachTo(0);
QScriptEngine engine;
debugger.attachTo(&engine);
QCOMPARE(debugger.state(), QScriptEngineDebugger::SuspendedState);
}
{
QScriptEngineDebugger debugger;
QScriptEngine engine;
QScriptValue oldPrint = engine.globalObject().property("print");
QVERIFY(oldPrint.isFunction());
QVERIFY(!engine.globalObject().property("__FILE__").isValid());
QVERIFY(!engine.globalObject().property("__LINE__").isValid());
debugger.attachTo(&engine);
QVERIFY(engine.globalObject().property("__FILE__").isUndefined());
QVERIFY(engine.globalObject().property("__LINE__").isNumber());
QVERIFY(!engine.globalObject().property("print").strictlyEquals(oldPrint));
debugger.detach();
QVERIFY(engine.globalObject().property("print").strictlyEquals(oldPrint));
QVERIFY(!engine.globalObject().property("__FILE__").isValid());
QVERIFY(!engine.globalObject().property("__LINE__").isValid());
}
{
QScriptEngineDebugger debugger;
QScriptEngine engine;
debugger.attachTo(&engine);
debugger.detach();
QScriptEngine engine2;
debugger.attachTo(&engine2);
}
{
QScriptEngineDebugger debugger;
QScriptEngine engine;
debugger.attachTo(&engine);
debugger.detach();
QScriptEngine engine2;
debugger.attachTo(&engine2);
debugger.detach();
}
#ifndef Q_OS_WINCE // demands too much memory for WinCE
{
QScriptEngineDebugger debugger;
QScriptEngine engine;
debugger.attachTo(&engine);
QScriptEngineDebugger debugger2;
debugger2.attachTo(&engine);
}
#endif
{
QScriptEngine *engine = new QScriptEngine;
QScriptEngineDebugger debugger;
debugger.attachTo(engine);
delete engine;
QScriptEngine engine2;
debugger.attachTo(&engine2);
}
}