当前位置: 首页>>代码示例>>C++>>正文


C++ QScriptBreakpointData::setEnabled方法代码示例

本文整理汇总了C++中QScriptBreakpointData::setEnabled方法的典型用法代码示例。如果您正苦于以下问题:C++ QScriptBreakpointData::setEnabled方法的具体用法?C++ QScriptBreakpointData::setEnabled怎么用?C++ QScriptBreakpointData::setEnabled使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在QScriptBreakpointData的用法示例。


在下文中一共展示了QScriptBreakpointData::setEnabled方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: setData

/*!
  \reimp
*/
bool QScriptBreakpointsModel::setData(const QModelIndex &index, const QVariant &value, int role)
{
    Q_D(QScriptBreakpointsModel);
    if (!index.isValid() || (index.row() >= d->breakpoints.size()))
        return false;
    const QPair<int, QScriptBreakpointData> &item = d->breakpoints.at(index.row());
    QScriptBreakpointData modifiedData;
    int col = index.column();
    if ((col == 0) || (col == 4)) {
        if (role == Qt::CheckStateRole) {
            modifiedData = item.second;
            if (col == 0)
                modifiedData.setEnabled(value.toInt() == Qt::Checked);
            else
                modifiedData.setSingleShot(value.toInt() == Qt::Checked);
        }
    } else if (col == 2) {
        if (role == Qt::EditRole) {
            modifiedData = item.second;
            modifiedData.setCondition(value.toString());
        }
    } else if (col == 3) {
        if (role == Qt::EditRole) {
            modifiedData = item.second;
            modifiedData.setIgnoreCount(value.toInt());
        }
    }
    if (!modifiedData.isValid())
        return false;
    QScriptDebuggerJob *job = new SetBreakpointDataJob(item.first, modifiedData, d->commandScheduler);
    d->jobScheduler->scheduleJob(job);
    return true;
}
开发者ID:RS102839,项目名称:qt,代码行数:36,代码来源:qscriptbreakpointsmodel.cpp

示例2: _q_onBreakpointEnableRequest

void QScriptDebuggerCodeWidgetPrivate::_q_onBreakpointEnableRequest(int lineNumber, bool enable)
{
    QScriptDebuggerCodeViewInterface *view = qobject_cast<QScriptDebuggerCodeViewInterface*>(q_func()->sender());
    qint64 sid = scriptId(view);
    int bpid = breakpointsModel->resolveBreakpoint(sid, lineNumber);
    if (bpid == -1)
        bpid = breakpointsModel->resolveBreakpoint(scriptsModel->scriptData(sid).fileName(), lineNumber);
    Q_ASSERT(bpid != -1);
    QScriptBreakpointData data = breakpointsModel->breakpointData(bpid);
    data.setEnabled(enable);
    breakpointsModel->setBreakpointData(bpid, data);
}
开发者ID:wpbest,项目名称:copperspice,代码行数:12,代码来源:qscriptdebuggercodewidget.cpp

示例3: breakpointDataFromScriptValue

static void breakpointDataFromScriptValue(const QScriptValue &in, QScriptBreakpointData &out)
{
    QScriptValue scriptId = in.property(QString::fromLatin1("scriptId"));
    if (scriptId.isValid())
        out.setScriptId((qint64)scriptId.toNumber());
    out.setFileName(in.property(QString::fromLatin1("fileName")).toString());
    out.setLineNumber(in.property(QString::fromLatin1("lineNumber")).toInt32());
    QScriptValue enabled = in.property(QString::fromLatin1("enabled"));
    if (enabled.isValid())
        out.setEnabled(enabled.toBoolean());
    QScriptValue singleShot = in.property(QString::fromLatin1("singleShot"));
    if (singleShot.isValid())
        out.setSingleShot(singleShot.toBoolean());
    out.setIgnoreCount(in.property(QString::fromLatin1("ignoreCount")).toInt32());
    out.setCondition(in.property(QString::fromLatin1("condition")).toString());
}
开发者ID:Drakey83,项目名称:steamlink-sdk,代码行数:16,代码来源:qscriptdebuggerconsole.cpp


注:本文中的QScriptBreakpointData::setEnabled方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。