Permalink
Browse files

Qt/debugger: recenter the code widget when selecting a breakpoint

  • Loading branch information...
aldelaro5 committed May 6, 2018
1 parent 53803c1 commit 09792fde70d5c0ae0386b2d9dc0b82825bc37de6
@@ -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 @@ class BreakpointWidget : public QDockWidget
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>(

0 comments on commit 09792fd

Please sign in to comment.