コード例 #1
0
static QScriptValue breakpointDataToScriptValue(QScriptEngine *eng, const QScriptBreakpointData &in)
{
    QScriptValue out = eng->newObject();
    out.setProperty(QString::fromLatin1("scriptId"), QScriptValue(eng, qsreal(in.scriptId())));
    out.setProperty(QString::fromLatin1("fileName"), QScriptValue(eng, in.fileName()));
    out.setProperty(QString::fromLatin1("lineNumber"), QScriptValue(eng, in.lineNumber()));
    out.setProperty(QString::fromLatin1("enabled"), QScriptValue(eng, in.isEnabled()));
    out.setProperty(QString::fromLatin1("singleShot"), QScriptValue(eng, in.isSingleShot()));
    out.setProperty(QString::fromLatin1("ignoreCount"), QScriptValue(eng, in.ignoreCount()));
    out.setProperty(QString::fromLatin1("condition"), QScriptValue(eng, in.condition()));
    return out;
}
コード例 #2
0
void QScriptDebuggerCodeWidgetPrivate::_q_onBreakpointsDataChanged(
    const QModelIndex &tl, const QModelIndex &br)
{
    for (int i = tl.row(); i <= br.row(); ++i) {
        QScriptBreakpointData data = breakpointsModel->breakpointDataAt(i);
        qint64 scriptId = data.scriptId();
        if (scriptId == -1) {
            scriptId = scriptsModel->resolveScript(data.fileName());
            if (scriptId == -1)
                continue;
        }
        QScriptDebuggerCodeViewInterface *view = viewHash.value(scriptId);
        if (!view)
            continue;
        view->setBreakpointEnabled(data.lineNumber(), data.isEnabled());
    }
}