mirror of
git://git.savannah.nongnu.org/eliot.git
synced 2025-01-18 10:26:15 +01:00
Stats: enable sorting when the table is flipped.
This allows sorting the players by rank, for example.
This commit is contained in:
parent
fa55eab82e
commit
c89e91010c
1 changed files with 7 additions and 1 deletions
|
@ -21,6 +21,7 @@
|
|||
#include <QtGui/QTableView>
|
||||
#include <QtGui/QHeaderView>
|
||||
#include <QtGui/QStandardItemModel>
|
||||
#include <QtGui/QSortFilterProxyModel>
|
||||
#include <QtGui/QVBoxLayout>
|
||||
#include <QtGui/QLabel>
|
||||
#include <QtGui/QAction>
|
||||
|
@ -457,10 +458,15 @@ void StatsWidget::lockSizesChanged(bool checked)
|
|||
void StatsWidget::flipTable()
|
||||
{
|
||||
bool flipped = m_table->model() != m_model;
|
||||
m_table->setSortingEnabled(!flipped);
|
||||
if (flipped)
|
||||
m_table->setModel(m_model);
|
||||
else
|
||||
m_table->setModel(m_flippedModel);
|
||||
{
|
||||
QSortFilterProxyModel *proxy = new QSortFilterProxyModel;
|
||||
proxy->setSourceModel(m_flippedModel);
|
||||
m_table->setModel(proxy);
|
||||
}
|
||||
refresh();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue