本文整理汇总了C++中QScriptBreakpointData::setCondition方法的典型用法代码示例。如果您正苦于以下问题:C++ QScriptBreakpointData::setCondition方法的具体用法?C++ QScriptBreakpointData::setCondition怎么用?C++ QScriptBreakpointData::setCondition使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QScriptBreakpointData
的用法示例。
在下文中一共展示了QScriptBreakpointData::setCondition方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
示例2: 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());
}