Crossfire Server, Trunk
ScriptFilterAssetModel Class Reference

#include <AssetModel.h>

+ Inheritance diagram for ScriptFilterAssetModel:
+ Collaboration diagram for ScriptFilterAssetModel:

Public Member Functions

const QString & filter () const
 
 ScriptFilterAssetModel (AssetModel *model, QScriptEngine *engine, QObject *parent)
 
void setFilter (const QString &filter)
 

Protected Member Functions

bool acceptItem (AssetWrapper *item) const
 
virtual bool filterAcceptsRow (int sourceRow, const QModelIndex &sourceParent) const override
 

Protected Attributes

std::map< AssetWrapper *, bool > myCachedFilter
 
QScriptEngine * myEngine
 
QString myFilter
 

Detailed Description

Proxy model filtering based on user-written filter, used in the main resource view.

Definition at line 78 of file AssetModel.h.

Constructor & Destructor Documentation

◆ ScriptFilterAssetModel()

ScriptFilterAssetModel::ScriptFilterAssetModel ( AssetModel model,
QScriptEngine *  engine,
QObject *  parent 
)

Definition at line 251 of file AssetModel.cpp.

Member Function Documentation

◆ acceptItem()

bool ScriptFilterAssetModel::acceptItem ( AssetWrapper item) const
protected

Definition at line 288 of file AssetModel.cpp.

References myEngine, and myFilter.

Referenced by filterAcceptsRow().

+ Here is the caller graph for this function:

◆ filter()

const QString& ScriptFilterAssetModel::filter ( ) const
inline

Definition at line 83 of file AssetModel.h.

References myFilter.

Referenced by CREResourcesWindow::onQuickFilter(), and setFilter().

+ Here is the caller graph for this function:

◆ filterAcceptsRow()

bool ScriptFilterAssetModel::filterAcceptsRow ( int  sourceRow,
const QModelIndex &  sourceParent 
) const
overrideprotectedvirtual

Definition at line 262 of file AssetModel.cpp.

References altar_valkyrie::accept(), acceptItem(), c, disinfect::count, npc_dialog::index, myCachedFilter, and myFilter.

+ Here is the call graph for this function:

◆ setFilter()

void ScriptFilterAssetModel::setFilter ( const QString &  filter)

Definition at line 256 of file AssetModel.cpp.

References filter(), myCachedFilter, and myFilter.

Referenced by CREResourcesWindow::setFilter().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ myCachedFilter

std::map<AssetWrapper *, bool> ScriptFilterAssetModel::myCachedFilter
mutableprotected

Definition at line 91 of file AssetModel.h.

Referenced by filterAcceptsRow(), and setFilter().

◆ myEngine

QScriptEngine* ScriptFilterAssetModel::myEngine
protected

Definition at line 89 of file AssetModel.h.

Referenced by acceptItem().

◆ myFilter

QString ScriptFilterAssetModel::myFilter
protected

Definition at line 90 of file AssetModel.h.

Referenced by acceptItem(), filter(), filterAcceptsRow(), and setFilter().


The documentation for this class was generated from the following files: