MCPcopy Create free account
hub / github.com/KDE/kdevelop / setupPopupMenu

Method setupPopupMenu

kdevplatform/debugger/breakpoint/breakpointwidget.cpp:118–161  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

116BreakpointWidget::~BreakpointWidget() = default;
117
118void BreakpointWidget::setupPopupMenu()
119{
120 Q_D(BreakpointWidget);
121
122 d->popup = new QMenu(this);
123
124 QMenu* newBreakpoint = d->popup->addMenu(i18nc("New breakpoint", "&New"));
125 newBreakpoint->setIcon(QIcon::fromTheme(QStringLiteral("list-add")));
126
127 QAction* action = newBreakpoint->addAction(
128 i18nc("Code breakpoint", "&Code"),
129 this,
130 SLOT(slotAddBlankBreakpoint()) );
131 // Use this action also to provide a local shortcut
132 action->setShortcut(QKeySequence(Qt::CTRL | Qt::Key_B, QKeyCombination{Qt::Key_C}));
133 addAction(action);
134
135 newBreakpoint->addAction(
136 i18nc("Data breakpoint", "Data &Write"),
137 this, SLOT(slotAddBlankWatchpoint()));
138 newBreakpoint->addAction(
139 i18nc("Data read breakpoint", "Data &Read"),
140 this, SLOT(slotAddBlankReadWatchpoint()));
141 newBreakpoint->addAction(
142 i18nc("Data access breakpoint", "Data &Access"),
143 this, SLOT(slotAddBlankAccessWatchpoint()));
144
145 QAction* breakpointDelete = d->popup->addAction(
146 QIcon::fromTheme(QStringLiteral("edit-delete")),
147 i18n( "&Delete" ),
148 this,
149 SLOT(slotRemoveBreakpoint()));
150 breakpointDelete->setShortcut(Qt::Key_Delete);
151 breakpointDelete->setShortcutContext(Qt::WidgetWithChildrenShortcut);
152 addAction(breakpointDelete);
153
154
155 d->popup->addSeparator();
156 d->breakpointDisableAllAction = d->popup->addAction(i18n("Disable &All"), this, SLOT(slotDisableAllBreakpoints()));
157 d->breakpointEnableAllAction = d->popup->addAction(i18n("&Enable All"), this, SLOT(slotEnableAllBreakpoints()));
158 d->breakpointRemoveAll = d->popup->addAction(i18n("&Remove All"), this, SLOT(slotRemoveAllBreakpoints()));
159
160 connect(d->popup, &QMenu::aboutToShow, this, &BreakpointWidget::slotPopupMenuAboutToShow);
161}
162
163
164void BreakpointWidget::contextMenuEvent(QContextMenuEvent* event)

Callers

nothing calls this directly

Calls 2

setIconMethod · 0.80
addActionMethod · 0.45

Tested by

no test coverage detected