diff --git a/pcsx2-qt/Debugger/CpuWidget.cpp b/pcsx2-qt/Debugger/CpuWidget.cpp index 0acc68ddd0bbb7..a4b425c4ad0a84 100644 --- a/pcsx2-qt/Debugger/CpuWidget.cpp +++ b/pcsx2-qt/Debugger/CpuWidget.cpp @@ -57,8 +57,12 @@ CpuWidget::CpuWidget(QWidget* parent, DebugInterface& cpu) connect(m_ui.memoryviewWidget, &MemoryViewWidget::gotoInDisasm, m_ui.disassemblyWidget, &DisassemblyWidget::gotoAddress); connect(m_ui.memoryviewWidget, &MemoryViewWidget::addToSavedAddresses, this, &CpuWidget::addAddressToSavedAddressesList); - connect(m_ui.registerWidget, &RegisterWidget::gotoInMemory, m_ui.memoryviewWidget, &MemoryViewWidget::gotoAddress); - connect(m_ui.disassemblyWidget, &DisassemblyWidget::gotoInMemory, m_ui.memoryviewWidget, &MemoryViewWidget::gotoAddress); + auto gotoAddress = [this](u32 address) { + m_ui.memoryviewWidget->gotoAddress(address); + m_ui.tabWidget->setCurrentWidget(m_ui.tab_memory); + }; + connect(m_ui.registerWidget, &RegisterWidget::gotoInMemory, this, gotoAddress); + connect(m_ui.disassemblyWidget, &DisassemblyWidget::gotoInMemory, this, gotoAddress); connect(m_ui.memoryviewWidget, &MemoryViewWidget::VMUpdate, this, &CpuWidget::reloadCPUWidgets); connect(m_ui.registerWidget, &RegisterWidget::VMUpdate, this, &CpuWidget::reloadCPUWidgets); @@ -752,6 +756,7 @@ void CpuWidget::onFuncListContextMenu(QPoint pos) QAction* gotoMemory = new QAction(tr("Go to in Memory View"), m_ui.listFunctions); connect(gotoMemory, &QAction::triggered, [this] { m_ui.memoryviewWidget->gotoAddress(m_ui.listFunctions->selectedItems().first()->data(Qt::UserRole).toUInt()); + m_ui.tabWidget->setCurrentWidget(m_ui.tab_memory); }); m_funclistContextMenu->addAction(gotoMemory); @@ -827,6 +832,7 @@ void CpuWidget::onModuleTreeContextMenu(QPoint pos) QAction* gotoMemory = new QAction(tr("Go to in Memory View"), m_ui.treeModules); connect(gotoMemory, &QAction::triggered, [this] { m_ui.memoryviewWidget->gotoAddress(m_ui.treeModules->selectedItems().first()->data(0, Qt::UserRole).toUInt()); + m_ui.tabWidget->setCurrentWidget(m_ui.tab_memory); }); m_moduleTreeContextMenu->addAction(gotoMemory); }