From d1a7430f800bf6c7003247aa3ea6a12b07a1ea30 Mon Sep 17 00:00:00 2001 From: KamFretoZ <14798312+kamfretoz@users.noreply.github.com> Date: Fri, 23 Aug 2024 00:37:55 +0700 Subject: [PATCH] Qt: Fix incorrect sort indicator on loading Backport from: https://github.com/stenzek/duckstation/commit/a56ebf24b2721d3cb07c5a71031ce2a80fd52903 --- pcsx2-qt/GameList/GameListWidget.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pcsx2-qt/GameList/GameListWidget.cpp b/pcsx2-qt/GameList/GameListWidget.cpp index 0df9cbc414..146c8e1e46 100644 --- a/pcsx2-qt/GameList/GameListWidget.cpp +++ b/pcsx2-qt/GameList/GameListWidget.cpp @@ -537,7 +537,10 @@ void GameListWidget::loadTableViewColumnSortSettings() .value_or(DEFAULT_SORT_COLUMN); const bool sort_descending = Host::GetBaseBoolSettingValue("GameListTableView", "SortDescending", DEFAULT_SORT_DESCENDING); - m_table_view->sortByColumn(sort_column, sort_descending ? Qt::DescendingOrder : Qt::AscendingOrder); + const Qt::SortOrder sort_order = sort_descending ? Qt::DescendingOrder : Qt::AscendingOrder; + m_sort_model->sort(sort_column, sort_order); + if (QHeaderView* hv = m_table_view->horizontalHeader()) + hv->setSortIndicator(sort_column, sort_order); } void GameListWidget::saveTableViewColumnSortSettings()