mirror of
https://github.com/stenzek/duckstation.git
synced 2025-06-09 21:07:23 +00:00
Qt/Debugger: Snap code view to center on goto address
This commit is contained in:
parent
936c945e73
commit
fe9d06a194
@ -93,11 +93,15 @@ void DebuggerWindow::scrollToCodeAddress(VirtualMemoryAddress address)
|
||||
{
|
||||
m_code_model->ensureAddressVisible(address);
|
||||
|
||||
int row = m_code_model->getRowForAddress(address);
|
||||
const int row = m_code_model->getRowForAddress(address);
|
||||
if (row >= 0)
|
||||
{
|
||||
qApp->processEvents(QEventLoop::ExcludeUserInputEvents);
|
||||
m_ui.codeView->scrollTo(m_code_model->index(row, 0));
|
||||
|
||||
const QModelIndex index = m_code_model->index(row, 0);
|
||||
m_ui.codeView->scrollTo(index, QAbstractItemView::PositionAtCenter);
|
||||
m_ui.codeView->selectionModel()->setCurrentIndex(index,
|
||||
QItemSelectionModel::ClearAndSelect | QItemSelectionModel::Rows);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user