本文整理汇总了C++中QScriptDebuggerValue::type方法的典型用法代码示例。如果您正苦于以下问题:C++ QScriptDebuggerValue::type方法的具体用法?C++ QScriptDebuggerValue::type怎么用?C++ QScriptDebuggerValue::type使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QScriptDebuggerValue
的用法示例。
在下文中一共展示了QScriptDebuggerValue::type方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: newScriptValueIteratorCommand
QScriptDebuggerCommand QScriptDebuggerCommand::newScriptValueIteratorCommand(const QScriptDebuggerValue &object)
{
QScriptDebuggerCommand cmd(NewScriptValueIterator);
Q_ASSERT(object.type() == QScriptDebuggerValue::ObjectValue);
cmd.setScriptValue(object);
return cmd;
}
示例2: scriptObjectSnapshotCaptureCommand
QScriptDebuggerCommand QScriptDebuggerCommand::scriptObjectSnapshotCaptureCommand(int id, const QScriptDebuggerValue &object)
{
Q_ASSERT(object.type() == QScriptDebuggerValue::ObjectValue);
QScriptDebuggerCommand cmd(ScriptObjectSnapshotCapture);
cmd.setSnapshotId(id);
cmd.setScriptValue(object);
return cmd;
}
示例3: execute
/*!
Applies the given \a command to the given \a backend.
*/
QScriptDebuggerResponse QScriptDebuggerCommandExecutor::execute(
QScriptDebuggerBackend *backend,
const QScriptDebuggerCommand &command)
{
QScriptDebuggerResponse response;
switch (command.type()) {
case QScriptDebuggerCommand::None:
break;
case QScriptDebuggerCommand::Interrupt:
backend->interruptEvaluation();
break;
case QScriptDebuggerCommand::Continue:
if (backend->engine()->isEvaluating()) {
backend->continueEvalution();
response.setAsync(true);
}
break;
case QScriptDebuggerCommand::StepInto: {
QVariant attr = command.attribute(QScriptDebuggerCommand::StepCount);
int count = attr.isValid() ? attr.toInt() : 1;
backend->stepInto(count);
response.setAsync(true);
} break;
case QScriptDebuggerCommand::StepOver: {
QVariant attr = command.attribute(QScriptDebuggerCommand::StepCount);
int count = attr.isValid() ? attr.toInt() : 1;
backend->stepOver(count);
response.setAsync(true);
} break;
case QScriptDebuggerCommand::StepOut:
backend->stepOut();
response.setAsync(true);
break;
case QScriptDebuggerCommand::RunToLocation:
backend->runToLocation(command.fileName(), command.lineNumber());
response.setAsync(true);
break;
case QScriptDebuggerCommand::RunToLocationByID:
backend->runToLocation(command.scriptId(), command.lineNumber());
response.setAsync(true);
break;
case QScriptDebuggerCommand::ForceReturn: {
int contextIndex = command.contextIndex();
QScriptDebuggerValue value = command.scriptValue();
QScriptEngine *engine = backend->engine();
QScriptValue realValue = value.toScriptValue(engine);
backend->returnToCaller(contextIndex, realValue);
response.setAsync(true);
} break;
case QScriptDebuggerCommand::Resume:
backend->resume();
response.setAsync(true);
break;
case QScriptDebuggerCommand::SetBreakpoint: {
QScriptBreakpointData data = command.breakpointData();
if (!data.isValid())
data = QScriptBreakpointData(command.fileName(), command.lineNumber());
int id = backend->setBreakpoint(data);
response.setResult(id);
} break;
case QScriptDebuggerCommand::DeleteBreakpoint: {
int id = command.breakpointId();
if (!backend->deleteBreakpoint(id))
response.setError(QScriptDebuggerResponse::InvalidBreakpointID);
} break;
case QScriptDebuggerCommand::DeleteAllBreakpoints:
backend->deleteAllBreakpoints();
break;
case QScriptDebuggerCommand::GetBreakpoints: {
QScriptBreakpointMap bps = backend->breakpoints();
if (!bps.isEmpty())
response.setResult(bps);
} break;
case QScriptDebuggerCommand::GetBreakpointData: {
int id = command.breakpointId();
QScriptBreakpointData data = backend->breakpointData(id);
if (data.isValid())
response.setResult(data);
else
response.setError(QScriptDebuggerResponse::InvalidBreakpointID);
} break;
case QScriptDebuggerCommand::SetBreakpointData: {
//.........这里部分代码省略.........