Add shortcuts to breakpoints widget (#1834)

* Add shortcuts to breakpoints widget
This commit is contained in:
Itay Cohen 2019-10-12 11:33:21 +03:00 committed by GitHub
parent 83b1ce2c49
commit 4aa6927066
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -127,10 +127,19 @@ BreakpointWidget::BreakpointWidget(MainWindow *main, QAction *action) :
});
setScrollMode();
actionDelBreakpoint = new QAction(tr("Delete breakpoint"), this);
actionToggleBreakpoint = new QAction(tr("Toggle breakpoint"), this);
actionDelBreakpoint->setShortcut(Qt::Key_Delete);
actionDelBreakpoint->setShortcutContext(Qt::WidgetShortcut);
connect(actionDelBreakpoint, &QAction::triggered, this, &BreakpointWidget::delBreakpoint);
ui->breakpointTreeView->addAction(actionDelBreakpoint);
actionToggleBreakpoint = new QAction(tr("Toggle breakpoint"), this);
actionToggleBreakpoint->setShortcut(Qt::Key_Space);
actionToggleBreakpoint->setShortcutContext(Qt::WidgetShortcut);
connect(actionToggleBreakpoint, &QAction::triggered, this, &BreakpointWidget::toggleBreakpoint);
ui->breakpointTreeView->addAction(actionToggleBreakpoint);
connect(Core(), &CutterCore::refreshAll, this, &BreakpointWidget::refreshBreakpoint);
connect(Core(), &CutterCore::breakpointsChanged, this, &BreakpointWidget::refreshBreakpoint);
connect(Core(), &CutterCore::refreshCodeViews, this, &BreakpointWidget::refreshBreakpoint);