mirror of
https://github.com/OpenMW/openmw.git
synced 2025-11-08 20:46:50 +00:00
Fix table being sorted twice (at least it appeared that way according to the sample profiler)
- Quoting Qt-4.8: "Note: . Setting the property to true with setSortingEnabled() immediately triggers a call to sortByColumn() with the current sort section and order."
(copied the changes from commit SHA-1: 77394fce99)
This commit is contained in:
parent
725d689e8a
commit
ee3361a118
1 changed files with 7 additions and 6 deletions
|
|
@ -269,12 +269,6 @@ CSVWorld::Table::Table (const CSMWorld::UniversalId& id,
|
||||||
setSelectionBehavior (QAbstractItemView::SelectRows);
|
setSelectionBehavior (QAbstractItemView::SelectRows);
|
||||||
setSelectionMode (QAbstractItemView::ExtendedSelection);
|
setSelectionMode (QAbstractItemView::ExtendedSelection);
|
||||||
|
|
||||||
setSortingEnabled (sorting);
|
|
||||||
if (sorting)
|
|
||||||
{
|
|
||||||
sortByColumn (mModel->findColumnIndex(CSMWorld::Columns::ColumnId_Id), Qt::AscendingOrder);
|
|
||||||
}
|
|
||||||
|
|
||||||
int columns = mModel->columnCount();
|
int columns = mModel->columnCount();
|
||||||
for (int i=0; i<columns; ++i)
|
for (int i=0; i<columns; ++i)
|
||||||
{
|
{
|
||||||
|
|
@ -295,6 +289,13 @@ CSVWorld::Table::Table (const CSMWorld::UniversalId& id,
|
||||||
hideColumn (i);
|
hideColumn (i);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (sorting)
|
||||||
|
{
|
||||||
|
// FIXME: some tables (e.g. CellRef) have this column hidden, which makes it confusing
|
||||||
|
sortByColumn (mModel->findColumnIndex(CSMWorld::Columns::ColumnId_Id), Qt::AscendingOrder);
|
||||||
|
}
|
||||||
|
setSortingEnabled (sorting);
|
||||||
|
|
||||||
mEditAction = new QAction (tr ("Edit Record"), this);
|
mEditAction = new QAction (tr ("Edit Record"), this);
|
||||||
connect (mEditAction, SIGNAL (triggered()), this, SLOT (editRecord()));
|
connect (mEditAction, SIGNAL (triggered()), this, SLOT (editRecord()));
|
||||||
mEditAction->setIcon(QIcon(":edit-edit"));
|
mEditAction->setIcon(QIcon(":edit-edit"));
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue