![]() |
ezEngine
Release 25.03
|
Model that maps a document to a qt tree model. More...
#include <RawDocumentTreeModel.moc.h>
Public Member Functions | |
ezQtDocumentTreeModel (const ezDocumentObjectManager *pTree, const ezUuid &root=ezUuid()) | |
const ezDocumentObjectManager * | GetDocumentTree () const |
void | AddAdapter (ezQtDocumentTreeModelAdapter *pAdapter) |
Adds an adapter. There can only be one adapter for any object type. Added adapters are taken ownership of by the model. | |
QModelIndex | ComputeModelIndex (const ezDocumentObject *pObject) const |
Returns the QModelIndex for the given object. Returned value is invalid if object is not mapped in model. | |
void | SetAllowDragDrop (bool bAllow) |
Enable drag&drop support, disabled by default. | |
virtual QModelIndex | index (int iRow, int iColumn, const QModelIndex &parent=QModelIndex()) const override |
virtual QModelIndex | parent (const QModelIndex &child) const override |
virtual int | rowCount (const QModelIndex &parent=QModelIndex()) const override |
virtual int | columnCount (const QModelIndex &parent=QModelIndex()) const override |
virtual Qt::ItemFlags | flags (const QModelIndex &index) const override |
virtual QVariant | data (const QModelIndex &index, int iRole=Qt::DisplayRole) const override |
virtual bool | setData (const QModelIndex &index, const QVariant &value, int iRole) override |
virtual Qt::DropActions | supportedDropActions () const override |
virtual bool | canDropMimeData (const QMimeData *pData, Qt::DropAction action, int iRow, int iColumn, const QModelIndex &parent) const override |
virtual bool | dropMimeData (const QMimeData *pData, Qt::DropAction action, int iRow, int iColumn, const QModelIndex &parent) override |
virtual QStringList | mimeTypes () const override |
virtual QMimeData * | mimeData (const QModelIndexList &indexes) const override |
Static Public Member Functions | |
static bool | MoveObjects (const ezDragDropInfo &info) |
Protected Member Functions | |
virtual void | TreeEventHandler (const ezDocumentObjectStructureEvent &e) |
Protected Attributes | |
const ezDocumentObjectManager * | m_pDocumentTree = nullptr |
const ezUuid | m_Root |
ezHashTable< const ezRTTI *, ezQtDocumentTreeModelAdapter * > | m_Adapters |
bool | m_bAllowDragDrop = false |
ezString | m_sTargetContext = "scenetree" |
Model that maps a document to a qt tree model.
Hierarchy is defined by ezQtDocumentTreeModelAdapter that have to be added via AddAdapter.