forked from teamnwah/openmw-tes3coop
Include only the columns that are visible for sorting. Should resolve Bug #2611.
This commit is contained in:
parent
c40987338d
commit
5c37079f0c
2 changed files with 16 additions and 2 deletions
|
@ -21,6 +21,18 @@ void CSMWorld::IdTableProxyModel::updateColumnMap()
|
|||
}
|
||||
}
|
||||
|
||||
bool CSMWorld::IdTableProxyModel::filterAcceptsColumn (int sourceColumn, const QModelIndex& sourceParent)
|
||||
const
|
||||
{
|
||||
int flags =
|
||||
sourceModel()->headerData (sourceColumn, Qt::Horizontal, CSMWorld::ColumnBase::Role_Flags).toInt();
|
||||
|
||||
if (flags & CSMWorld::ColumnBase::Flag_Table)
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
bool CSMWorld::IdTableProxyModel::filterAcceptsRow (int sourceRow, const QModelIndex& sourceParent)
|
||||
const
|
||||
{
|
||||
|
|
|
@ -24,8 +24,6 @@ namespace CSMWorld
|
|||
|
||||
void updateColumnMap();
|
||||
|
||||
bool filterAcceptsRow (int sourceRow, const QModelIndex& sourceParent) const;
|
||||
|
||||
public:
|
||||
|
||||
IdTableProxyModel (QObject *parent = 0);
|
||||
|
@ -39,6 +37,10 @@ namespace CSMWorld
|
|||
protected:
|
||||
|
||||
bool lessThan(const QModelIndex &left, const QModelIndex &right) const;
|
||||
|
||||
virtual bool filterAcceptsRow (int sourceRow, const QModelIndex& sourceParent) const;
|
||||
|
||||
virtual bool filterAcceptsColumn (int sourceColumn, const QModelIndex& sourceParent) const;
|
||||
};
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue