diff --git a/ui/registerswidget.cpp b/ui/registerswidget.cpp index b684efa8..33b427bc 100644 --- a/ui/registerswidget.cpp +++ b/ui/registerswidget.cpp @@ -657,6 +657,38 @@ void DebugRegistersWidget::onDoubleClicked() } +void DebugRegistersWidget::mousePressEvent(QMouseEvent *event) +{ + if (event->button() == Qt::MiddleButton) + { + QModelIndexList sel = selectionModel()->selectedIndexes(); + if (sel.empty()) + return; + + auto sourceIndex = m_filter->mapToSource(sel[0]); + if (!sourceIndex.isValid()) + return; + + auto reg = m_model->getRow(sourceIndex.row()); + uint64_t value = reg.value(); + + UIContext* context = UIContext::contextForWidget(this); + if (!context) + return; + + View* view = context->getCurrentView(); + if (!view) + return; + + view->navigateOnOtherPane(value); + } + else + { + QTableView::mousePressEvent(event); + } +} + + void DebugRegistersWidget::editValue() { QModelIndexList sel = selectionModel()->selectedIndexes(); diff --git a/ui/registerswidget.h b/ui/registerswidget.h index 7cd83b70..a1c13808 100644 --- a/ui/registerswidget.h +++ b/ui/registerswidget.h @@ -199,6 +199,9 @@ private slots: public slots: void updateContent(); void showContextMenu(); + +protected: + virtual void mousePressEvent(QMouseEvent* event) override; };