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


C++ Breakpoint::enabled方法代码示例

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


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

示例1: slotPopupMenuAboutToShow

void BreakpointWidget::slotPopupMenuAboutToShow()
{
    if (m_debugController->breakpointModel()->rowCount() < 1) {
        m_breakpointDisableAllAction->setDisabled(true);
        m_breakpointEnableAllAction->setDisabled(true);
        m_breakpointRemoveAll->setDisabled(true);
    } else {
        m_breakpointRemoveAll->setEnabled(true);
        bool allDisabled = true;
        bool allEnabled = true;
        for (int i = 0; i < m_debugController->breakpointModel()->rowCount(); i++) {
            Breakpoint *bp = m_debugController->breakpointModel()->breakpoint(i);
            if (bp->enabled())
                allDisabled = false;
            else
                allEnabled = false;
        }
        m_breakpointDisableAllAction->setDisabled(allDisabled);
        m_breakpointEnableAllAction->setDisabled(allEnabled);
    }

}
开发者ID:KDE,项目名称:kdevplatform,代码行数:22,代码来源:breakpointwidget.cpp

示例2: 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;
}
开发者ID:mali,项目名称:kdevplatform,代码行数:36,代码来源:breakpointmodel.cpp


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