Crossfire Server, Trunk
AssetModel Class Reference

#include <AssetModel.h>

+ Inheritance diagram for AssetModel:
+ Collaboration diagram for AssetModel:

Public Member Functions

 AssetModel (AssetWrapper *assets, QObject *parent)
 
virtual bool canDropMimeData (const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent) const override
 
virtual int columnCount (const QModelIndex &parent) const override
 
virtual QVariant data (const QModelIndex &index, int role) const override
 
virtual bool dropMimeData (const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent) override
 
virtual Qt::ItemFlags flags (const QModelIndex &index) const override
 
virtual QVariant headerData (int section, Qt::Orientation orientation, int role) const override
 
virtual QModelIndex index (int row, int column, const QModelIndex &parent) const override
 
virtual QMimeData * mimeData (const QModelIndexList &indexes) const override
 
virtual QModelIndex parent (const QModelIndex &index) const override
 
virtual int rowCount (const QModelIndex &parent) const override
 
virtual ~AssetModel ()
 

Protected Slots

void assetModified (AssetWrapper *asset, AssetWrapper::ChangeType type, int extra)
 

Private Attributes

AssetWrappermyAssets
 

Detailed Description

Qt model representing all items in CRE, with the exception of experience.

Definition at line 29 of file AssetModel.h.

Constructor & Destructor Documentation

◆ AssetModel()

AssetModel::AssetModel ( AssetWrapper assets,
QObject *  parent 
)

Definition at line 18 of file AssetModel.cpp.

References assetModified(), and myAssets.

+ Here is the call graph for this function:

◆ ~AssetModel()

AssetModel::~AssetModel ( )
virtual

Definition at line 23 of file AssetModel.cpp.

Member Function Documentation

◆ assetModified

◆ canDropMimeData()

bool AssetModel::canDropMimeData ( const QMimeData *  data,
Qt::DropAction  action,
int  row,
int  column,
const QModelIndex &  parent 
) const
overridevirtual

Definition at line 121 of file AssetModel.cpp.

References convert::action, AssetWrapper::canDrop(), data(), parent(), and nlohmann::detail::void().

+ Here is the call graph for this function:

◆ columnCount()

int AssetModel::columnCount ( const QModelIndex &  parent) const
overridevirtual

Definition at line 26 of file AssetModel.cpp.

◆ data()

QVariant AssetModel::data ( const QModelIndex &  index,
int  role 
) const
overridevirtual

Definition at line 70 of file AssetModel.cpp.

References AssetWrapper::displayIcon(), and index().

Referenced by canDropMimeData(), CREResourcesWindow::CREResourcesWindow(), dropMimeData(), and mimeData().

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

◆ dropMimeData()

bool AssetModel::dropMimeData ( const QMimeData *  data,
Qt::DropAction  action,
int  row,
int  column,
const QModelIndex &  parent 
)
overridevirtual

Definition at line 134 of file AssetModel.cpp.

References convert::action, data(), AssetWrapper::drop(), parent(), and nlohmann::detail::void().

+ Here is the call graph for this function:

◆ flags()

Qt::ItemFlags AssetModel::flags ( const QModelIndex &  index) const
overridevirtual

Definition at line 94 of file AssetModel.cpp.

References index().

+ Here is the call graph for this function:

◆ headerData()

QVariant AssetModel::headerData ( int  section,
Qt::Orientation  orientation,
int  role 
) const
overridevirtual

Definition at line 82 of file AssetModel.cpp.

References nlohmann::detail::void().

+ Here is the call graph for this function:

◆ index()

QModelIndex AssetModel::index ( int  row,
int  column,
const QModelIndex &  parent 
) const
overridevirtual

Definition at line 30 of file AssetModel.cpp.

References AssetWrapper::child(), AssetWrapper::childrenCount(), myAssets, and parent().

Referenced by data(), CREMainWindow::doResourceWindow(), flags(), mimeData(), and parent().

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

◆ mimeData()

QMimeData * AssetModel::mimeData ( const QModelIndexList &  indexes) const
overridevirtual

Definition at line 105 of file AssetModel.cpp.

References data(), and index().

+ Here is the call graph for this function:

◆ parent()

QModelIndex AssetModel::parent ( const QModelIndex &  index) const
overridevirtual

Definition at line 47 of file AssetModel.cpp.

References index().

Referenced by assetModified(), canDropMimeData(), dropMimeData(), index(), and rowCount().

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

◆ rowCount()

int AssetModel::rowCount ( const QModelIndex &  parent) const
overridevirtual

Definition at line 63 of file AssetModel.cpp.

References AssetWrapper::childrenCount(), myAssets, and parent().

+ Here is the call graph for this function:

Field Documentation

◆ myAssets

AssetWrapper* AssetModel::myAssets
private

Definition at line 52 of file AssetModel.h.

Referenced by AssetModel(), index(), and rowCount().


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