Debugger: Double clicking Memory Search result switches to memory view tab

Previously when double clicking a memory search result it would go to the address but not switch to the memory view tab if the user wasn't already on it.
Now it ensures the user moves to the memory view widget, as this is almost always going to be the user's intention.
This commit is contained in:
Dan McCarthy 2023-12-30 20:05:58 -06:00 committed by Connor McLaughlin
parent 3a03b579d2
commit b9c7dacbd1
1 changed files with 5 additions and 1 deletions

View File

@ -102,7 +102,11 @@ CpuWidget::CpuWidget(QWidget* parent, DebugInterface& cpu)
m_ui.listSearchResults->setContextMenuPolicy(Qt::CustomContextMenu);
connect(m_ui.btnSearch, &QPushButton::clicked, this, &CpuWidget::onSearchButtonClicked);
connect(m_ui.btnFilterSearch, &QPushButton::clicked, this, &CpuWidget::onSearchButtonClicked);
connect(m_ui.listSearchResults, &QListWidget::itemDoubleClicked, [this](QListWidgetItem* item) { m_ui.memoryviewWidget->gotoAddress(item->text().toUInt(nullptr, 16)); });
connect(m_ui.listSearchResults, &QListWidget::itemDoubleClicked, [this](QListWidgetItem* item)
{
m_ui.tabWidget->setCurrentWidget(m_ui.tab_memory);
m_ui.memoryviewWidget->gotoAddress(item->text().toUInt(nullptr, 16));
});
connect(m_ui.listSearchResults->verticalScrollBar(), &QScrollBar::valueChanged, this, &CpuWidget::onSearchResultsListScroll);
connect(m_ui.listSearchResults, &QListView::customContextMenuRequested, this, &CpuWidget::onListSearchResultsContextMenu);
connect(m_ui.cmbSearchType, &QComboBox::currentIndexChanged, [this](int i) {