mirror of
https://github.com/RetroDECK/Duckstation.git
synced 2025-01-17 22:25:37 +00:00
Qt: Fix game list sorting by column
This commit is contained in:
parent
69f03959aa
commit
c8954a3089
|
@ -232,7 +232,7 @@ public:
|
|||
const QVariant left = source_left.data(Qt::InitialSortOrderRole);
|
||||
const QVariant right = source_right.data(Qt::InitialSortOrderRole);
|
||||
if (left != right)
|
||||
return ascending ? (left < right) : (right < left);
|
||||
return ascending ? (left < right) : (right > left);
|
||||
|
||||
// fallback to sorting by title for equal items
|
||||
return m_model->titlesLessThan(source_left.row(), source_right.row(), ascending);
|
||||
|
@ -270,6 +270,9 @@ void GameListWidget::initialize(QtHostInterface* host_interface)
|
|||
m_table_view->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn);
|
||||
m_table_view->resizeColumnsToContents();
|
||||
|
||||
// sort by disc type, then title
|
||||
m_table_sort_model->sort(0, Qt::AscendingOrder);
|
||||
|
||||
connect(m_table_view->selectionModel(), &QItemSelectionModel::currentChanged, this,
|
||||
&GameListWidget::onSelectionModelCurrentChanged);
|
||||
connect(m_table_view, &QTableView::doubleClicked, this, &GameListWidget::onTableViewItemDoubleClicked);
|
||||
|
|
Loading…
Reference in a new issue