Hide base land textures.
parent
dfcbee3ab1
commit
137ea872d3
@ -0,0 +1,21 @@
|
||||
#include "landtexturetableproxymodel.hpp"
|
||||
|
||||
#include "idtable.hpp"
|
||||
|
||||
namespace CSMWorld
|
||||
{
|
||||
LandTextureTableProxyModel::LandTextureTableProxyModel(QObject* parent)
|
||||
: IdTableProxyModel(parent)
|
||||
{
|
||||
}
|
||||
|
||||
bool LandTextureTableProxyModel::filterAcceptsRow (int sourceRow, const QModelIndex& sourceParent) const
|
||||
{
|
||||
int columnIndex = mSourceModel->findColumnIndex(Columns::ColumnId_Modification);
|
||||
QModelIndex index = mSourceModel->index(sourceRow, columnIndex);
|
||||
if (mSourceModel->data(index).toInt() != RecordBase::State_ModifiedOnly)
|
||||
return false;
|
||||
|
||||
return IdTableProxyModel::filterAcceptsRow(sourceRow, sourceParent);
|
||||
}
|
||||
}
|
@ -0,0 +1,22 @@
|
||||
#ifndef CSM_WORLD_LANDTEXTURETABLEPROXYMODEL_H
|
||||
#define CSM_WORLD_LANDTEXTURETABLEPROXYMODEL_H
|
||||
|
||||
#include "idtableproxymodel.hpp"
|
||||
|
||||
namespace CSMWorld
|
||||
{
|
||||
/// \brief Removes base records from filtered results.
|
||||
class LandTextureTableProxyModel : public IdTableProxyModel
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
|
||||
LandTextureTableProxyModel(QObject* parent = nullptr);
|
||||
|
||||
protected:
|
||||
|
||||
bool filterAcceptsRow (int sourceRow, const QModelIndex& sourceParent) const override;
|
||||
};
|
||||
}
|
||||
|
||||
#endif
|
Loading…
Reference in New Issue