Medical Imaging Interaction Toolkit  2024.06.00
Medical Imaging Interaction Toolkit
QmitkDataStorageSimpleTreeModel Class Reference

The 'QmitkDataStorageSimpleTreeModel' is a basic tree model, derived from the 'QmitkAbstractDataStorageModel'. It provides functions to accept a data storage and a node predicate in order to customize the model data nodes. Furthermore it overrides the functions of 'QAbstractItemModel' to create a simple qt list model.* This model can be used in conjunction with a 'QmitkDataStorageSelectionConnector'. This model is a "light" version of the classic QmitkDataStorgageTreeModel. The differences between both are the following: More...

#include <QmitkDataStorageSimpleTreeModel.h>

Inheritance diagram for QmitkDataStorageSimpleTreeModel:
Collaboration diagram for QmitkDataStorageSimpleTreeModel:

Public Member Functions

 QmitkDataStorageSimpleTreeModel (QObject *parent)
 
 ~QmitkDataStorageSimpleTreeModel () override
 
void DataStorageChanged () override
 
void NodePredicateChanged () override
 
void NodeAdded (const mitk::DataNode *node) override
 
void NodeChanged (const mitk::DataNode *node) override
 
void NodeRemoved (const mitk::DataNode *node) override
 
QModelIndex index (int row, int column, const QModelIndex &parent=QModelIndex()) const override
 
QModelIndex parent (const QModelIndex &child) const override
 
int rowCount (const QModelIndex &parent=QModelIndex()) const override
 
int columnCount (const QModelIndex &parent=QModelIndex()) const override
 
QVariant data (const QModelIndex &index, int role=Qt::DisplayRole) const override
 
bool setData (const QModelIndex &index, const QVariant &value, int role=Qt::EditRole) override
 
QVariant headerData (int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const override
 
Qt::ItemFlags flags (const QModelIndex &index) const override
 
- Public Member Functions inherited from QmitkAbstractDataStorageModel
 ~QmitkAbstractDataStorageModel () override
 
void SetDataStorage (mitk::DataStorage *dataStorage)
 
mitk::DataStorage::Pointer GetDataStorage () const
 
void SetNodePredicate (const mitk::NodePredicateBase *nodePredicate)
 
const mitk::NodePredicateBaseGetNodePredicate () const
 

Protected Types

using TreeItem = QmitkDataStorageTreeModelInternalItem
 

Additional Inherited Members

- Protected Member Functions inherited from QmitkAbstractDataStorageModel
 QmitkAbstractDataStorageModel (QObject *parent=nullptr)
 
 QmitkAbstractDataStorageModel (mitk::DataStorage *dataStorage, QObject *parent=nullptr)
 
- Protected Attributes inherited from QmitkAbstractDataStorageModel
mitk::WeakPointer< mitk::DataStoragem_DataStorage
 
mitk::NodePredicateBase::ConstPointer m_NodePredicate
 

Detailed Description

The 'QmitkDataStorageSimpleTreeModel' is a basic tree model, derived from the 'QmitkAbstractDataStorageModel'. It provides functions to accept a data storage and a node predicate in order to customize the model data nodes. Furthermore it overrides the functions of 'QAbstractItemModel' to create a simple qt list model.* This model can be used in conjunction with a 'QmitkDataStorageSelectionConnector'. This model is a "light" version of the classic QmitkDataStorgageTreeModel. The differences between both are the following:

  • This class currently does not support DragNDrop.
  • This class does not have the ability to change hierarchy or changes the layer property of nodes. This was skipped on purpose, because that is not the job of the storage model.
  • If a tree item A is removed this class does not attach children of A to the parent of A. Instead the complete tree representation is updated. This was changed on purpose because otherwise the internal representation of the model would not reflect the data storage graph anymore.

Definition at line 36 of file QmitkDataStorageSimpleTreeModel.h.

Member Typedef Documentation

◆ TreeItem

Constructor & Destructor Documentation

◆ QmitkDataStorageSimpleTreeModel()

QmitkDataStorageSimpleTreeModel::QmitkDataStorageSimpleTreeModel ( QObject *  parent)

◆ ~QmitkDataStorageSimpleTreeModel()

QmitkDataStorageSimpleTreeModel::~QmitkDataStorageSimpleTreeModel ( )
override

Member Function Documentation

◆ columnCount()

int QmitkDataStorageSimpleTreeModel::columnCount ( const QModelIndex &  parent = QModelIndex()) const
override

◆ data()

QVariant QmitkDataStorageSimpleTreeModel::data ( const QModelIndex &  index,
int  role = Qt::DisplayRole 
) const
override

◆ DataStorageChanged()

void QmitkDataStorageSimpleTreeModel::DataStorageChanged ( )
overridevirtual

◆ flags()

Qt::ItemFlags QmitkDataStorageSimpleTreeModel::flags ( const QModelIndex &  index) const
override

◆ headerData()

QVariant QmitkDataStorageSimpleTreeModel::headerData ( int  section,
Qt::Orientation  orientation,
int  role = Qt::DisplayRole 
) const
override

◆ index()

QModelIndex QmitkDataStorageSimpleTreeModel::index ( int  row,
int  column,
const QModelIndex &  parent = QModelIndex() 
) const
override

◆ NodeAdded()

void QmitkDataStorageSimpleTreeModel::NodeAdded ( const mitk::DataNode node)
overridevirtual

◆ NodeChanged()

void QmitkDataStorageSimpleTreeModel::NodeChanged ( const mitk::DataNode node)
overridevirtual

◆ NodePredicateChanged()

void QmitkDataStorageSimpleTreeModel::NodePredicateChanged ( )
overridevirtual

◆ NodeRemoved()

void QmitkDataStorageSimpleTreeModel::NodeRemoved ( const mitk::DataNode node)
overridevirtual

◆ parent()

QModelIndex QmitkDataStorageSimpleTreeModel::parent ( const QModelIndex &  child) const
override

◆ rowCount()

int QmitkDataStorageSimpleTreeModel::rowCount ( const QModelIndex &  parent = QModelIndex()) const
override

◆ setData()

bool QmitkDataStorageSimpleTreeModel::setData ( const QModelIndex &  index,
const QVariant &  value,
int  role = Qt::EditRole 
)
override

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