mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-01-26 03:35:26 +00:00
Qt/debugger: recenter the code widget when selecting a breakpoint
This commit is contained in:
parent
53803c1fca
commit
09792fde70
@ -80,6 +80,15 @@ void BreakpointWidget::CreateWidgets()
|
||||
m_table->setEditTriggers(QAbstractItemView::NoEditTriggers);
|
||||
m_table->verticalHeader()->hide();
|
||||
|
||||
connect(m_table, &QTableWidget::itemClicked, [this](QTableWidgetItem* item) {
|
||||
if (m_table->selectedItems()[0]->row() == item->row() &&
|
||||
Core::GetState() == Core::State::Paused)
|
||||
{
|
||||
auto address = m_table->selectedItems()[0]->data(Qt::UserRole).toUInt();
|
||||
emit SelectedBreakpoint(address);
|
||||
}
|
||||
});
|
||||
|
||||
auto* layout = new QVBoxLayout;
|
||||
|
||||
layout->addWidget(m_toolbar);
|
||||
|
@ -29,6 +29,7 @@ public:
|
||||
|
||||
signals:
|
||||
void BreakpointsChanged();
|
||||
void SelectedBreakpoint(u32 address);
|
||||
|
||||
protected:
|
||||
void closeEvent(QCloseEvent*) override;
|
||||
|
@ -54,6 +54,7 @@
|
||||
#include "DolphinQt2/Config/Mapping/MappingWindow.h"
|
||||
#include "DolphinQt2/Config/SettingsWindow.h"
|
||||
#include "DolphinQt2/Debugger/BreakpointWidget.h"
|
||||
#include "DolphinQt2/Debugger/CodeViewWidget.h"
|
||||
#include "DolphinQt2/Debugger/CodeWidget.h"
|
||||
#include "DolphinQt2/Debugger/JITWidget.h"
|
||||
#include "DolphinQt2/Debugger/MemoryWidget.h"
|
||||
@ -245,6 +246,10 @@ void MainWindow::CreateComponents()
|
||||
&CodeWidget::Update);
|
||||
connect(m_breakpoint_widget, &BreakpointWidget::BreakpointsChanged, m_memory_widget,
|
||||
&MemoryWidget::Update);
|
||||
connect(m_breakpoint_widget, &BreakpointWidget::SelectedBreakpoint, [this](u32 address) {
|
||||
if (Core::GetState() == Core::State::Paused)
|
||||
m_code_widget->SetAddress(address, CodeViewWidget::SetAddressUpdate::WithUpdate);
|
||||
});
|
||||
|
||||
#if defined(HAVE_XRANDR) && HAVE_XRANDR
|
||||
m_xrr_config = std::make_unique<X11Utils::XRRConfiguration>(
|
||||
|
Loading…
x
Reference in New Issue
Block a user