本文整理汇总了C++中Breakpoint::setData方法的典型用法代码示例。如果您正苦于以下问题:C++ Breakpoint::setData方法的具体用法?C++ Breakpoint::setData怎么用?C++ Breakpoint::setData使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Breakpoint
的用法示例。
在下文中一共展示了Breakpoint::setData方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: markContextMenuRequested
void BreakpointModel::markContextMenuRequested(Document* document, Mark mark, const QPoint &pos, bool& handled)
{
int type = mark.type;
qCDebug(DEBUGGER) << type;
/* Is this a breakpoint mark, to begin with? */
if (!(type & AllBreakpointMarks)) return;
Breakpoint *b = breakpoint(document->url(), mark.line);
if (!b) {
QMessageBox::critical(nullptr, i18n("Breakpoint not found"), i18n("Couldn't find breakpoint at %1:%2", document->url().toString(), mark.line));
return;
}
QMenu menu;
QAction deleteAction(QIcon::fromTheme(QStringLiteral("edit-delete")), i18n("&Delete Breakpoint"), 0);
QAction disableAction(QIcon::fromTheme(QStringLiteral("dialog-cancel")), i18n("&Disable Breakpoint"), 0);
QAction enableAction(QIcon::fromTheme(QStringLiteral("dialog-ok-apply")), i18n("&Enable Breakpoint"), 0);
menu.addAction(&deleteAction);
if (b->enabled()) {
menu.addAction(&disableAction);
} else {
menu.addAction(&enableAction);
}
QAction *a = menu.exec(pos);
if (a == &deleteAction) {
b->setDeleted();
} else if (a == &disableAction) {
b->setData(Breakpoint::EnableColumn, Qt::Unchecked);
} else if (a == &enableAction) {
b->setData(Breakpoint::EnableColumn, Qt::Checked);
}
handled = true;
}
示例2: slotDataInserted
void BreakpointWidget::slotDataInserted(int column, const QVariant& value)
{
Breakpoint* breakpoint = m_debugController->breakpointModel()->addCodeBreakpoint();
breakpoint->setData(column, value);
}