File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ limitations under the License.
2222#include < QKeyEvent>
2323#include < QStringList>
2424#include < algorithm>
25+ #include < QMouseEvent>
2526#include " breakpointswidget.h"
2627#include " ui.h"
2728#include " menus.h"
@@ -349,6 +350,25 @@ void DebugBreakpointsWidget::keyPressEvent(QKeyEvent* event)
349350}
350351
351352
353+ void DebugBreakpointsWidget::mousePressEvent (QMouseEvent* event)
354+ {
355+ QModelIndex index = indexAt (event->pos ());
356+ if (index.isValid () && index.column () == DebugBreakpointsListModel::EnabledColumn)
357+ {
358+ // Toggle breakpoint enabled state when clicking on enabled column
359+ BreakpointItem bp = m_model->getRow (index.row ());
360+ if (bp.enabled ())
361+ m_controller->DisableBreakpoint (bp.location ());
362+ else
363+ m_controller->EnableBreakpoint (bp.location ());
364+ return ; // Don't call parent to avoid selection change
365+ }
366+
367+ // Call parent for normal behavior
368+ QTableView::mousePressEvent (event);
369+ }
370+
371+
352372bool DebugBreakpointsWidget::selectionNotEmpty ()
353373{
354374 QModelIndexList sel = selectionModel ()->selectedIndexes ();
Original file line number Diff line number Diff line change @@ -135,6 +135,7 @@ class DebugBreakpointsWidget : public QTableView
135135
136136 virtual void contextMenuEvent (QContextMenuEvent* event) override ;
137137 virtual void keyPressEvent (QKeyEvent* event) override ;
138+ virtual void mousePressEvent (QMouseEvent* event) override ;
138139
139140public:
140141 DebugBreakpointsWidget (ViewFrame* view, BinaryViewRef data, Menu* menu);
You can’t perform that action at this time.
0 commit comments