From ade2b4baeac0d6b7497c5dc0f28c9e78e07a5730 Mon Sep 17 00:00:00 2001 From: Ty Lamontagne Date: Mon, 9 Oct 2023 18:11:28 -0400 Subject: [PATCH] Debugger Thread List: Sorting --- pcsx2-qt/Debugger/CpuWidget.cpp | 5 ++++- pcsx2-qt/Debugger/CpuWidget.h | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/pcsx2-qt/Debugger/CpuWidget.cpp b/pcsx2-qt/Debugger/CpuWidget.cpp index 8d2d4e721c..cb6e5b2dac 100644 --- a/pcsx2-qt/Debugger/CpuWidget.cpp +++ b/pcsx2-qt/Debugger/CpuWidget.cpp @@ -68,7 +68,10 @@ CpuWidget::CpuWidget(QWidget* parent, DebugInterface& cpu) connect(m_ui.threadList, &QTableView::doubleClicked, this, &CpuWidget::onThreadListDoubleClick); m_ui.threadList->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch); - m_ui.threadList->setModel(&m_threadModel); + m_threadProxyModel.setSourceModel(&m_threadModel); + m_ui.threadList->setModel(&m_threadProxyModel); + m_ui.threadList->setSortingEnabled(true); + m_ui.threadList->sortByColumn(ThreadModel::ThreadColumns::ID, Qt::SortOrder::AscendingOrder); connect(m_ui.stackList, &QTableView::customContextMenuRequested, this, &CpuWidget::onStackListContextMenu); connect(m_ui.stackList, &QTableView::doubleClicked, this, &CpuWidget::onStackListDoubleClick); diff --git a/pcsx2-qt/Debugger/CpuWidget.h b/pcsx2-qt/Debugger/CpuWidget.h index 4329916ef0..f9da112935 100644 --- a/pcsx2-qt/Debugger/CpuWidget.h +++ b/pcsx2-qt/Debugger/CpuWidget.h @@ -29,6 +29,7 @@ #include "QtHost.h" #include #include +#include #include @@ -103,6 +104,7 @@ private: BreakpointModel m_bpModel; ThreadModel m_threadModel; + QSortFilterProxyModel m_threadProxyModel; StackModel m_stackModel; bool m_demangleFunctions = true;