Stats: sort by ranking when the table is flipped

This commit is contained in:
Olivier Teulière 2013-01-07 18:52:20 +01:00
parent 579106828c
commit bbcb79625d

View file

@ -474,8 +474,13 @@ void StatsWidget::flipTable()
else
{
QSortFilterProxyModel *proxy = new QSortFilterProxyModel;
proxy->setDynamicSortFilter(true);
proxy->setSourceModel(m_flippedModel);
m_table->setModel(proxy);
// Sort by ranking (last column)
const int col = m_flippedModel->columnCount() - 1;
m_table->sortByColumn(col);
m_table->horizontalHeader()->setSortIndicator(col, Qt::AscendingOrder);
}
refresh();
}