Medical Imaging Interaction Toolkit  2026.06.00
Medical Imaging Interaction Toolkit
QmitkDataStorageDefaultListModel.h
Go to the documentation of this file.
1 /*============================================================================
2 
3 The Medical Imaging Interaction Toolkit (MITK)
4 
5 Copyright (c) German Cancer Research Center (DKFZ)
6 All rights reserved.
7 
8 Use of this source code is governed by a 3-clause BSD license that can be
9 found in the LICENSE file.
10 
11 ============================================================================*/
12 
13 #ifndef QmitkDataStorageDefaultListModel_h
14 #define QmitkDataStorageDefaultListModel_h
15 
16 #include <MitkQtWidgetsExports.h>
17 
18 // qt widgets module
20 
34 {
35  Q_OBJECT
36 
37 public:
38 
44 
46  void DataStorageChanged() override;
47 
49  void NodePredicateChanged() override;
50 
55  void NodeAdded(const mitk::DataNode* node) override;
56 
61  void NodeChanged(const mitk::DataNode* node) override;
62 
67  void NodeRemoved(const mitk::DataNode* node) override;
68 
76  QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const override;
77 
83  QModelIndex parent(const QModelIndex &child) const override;
84 
90  int rowCount(const QModelIndex &parent = QModelIndex()) const override;
91 
97  int columnCount(const QModelIndex &parent = QModelIndex()) const override;
98 
109  QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
110 
118  QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override;
119 
125  Qt::ItemFlags flags(const QModelIndex &index) const override;
126 
127 protected:
128 
129  virtual void UpdateModelData();
130 
131  std::vector<mitk::DataNode::Pointer> m_DataNodes;
132 
133 };
134 
135 #endif
#define MITKQTWIDGETS_EXPORT
Abstract base class extending QAbstractItemModel for DataStorage-backed models.
A flat list model that exposes DataStorage nodes matching an optional predicate.
void NodeRemoved(const mitk::DataNode *node) override
Called when a node is removed from the data storage.
QVariant headerData(int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const override
Returns header data for the given section and orientation.
void DataStorageChanged() override
Called when the data storage has changed. Rebuilds the model data.
QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const override
Returns data for the given index and role.
QmitkDataStorageDefaultListModel(QObject *parent)
Constructs the model.
QModelIndex parent(const QModelIndex &child) const override
Returns the parent index. Always returns an invalid index (flat model).
QModelIndex index(int row, int column, const QModelIndex &parent=QModelIndex()) const override
Returns the model index for the given row and column.
void NodeAdded(const mitk::DataNode *node) override
Called when a node is added to the data storage.
int rowCount(const QModelIndex &parent=QModelIndex()) const override
Returns the number of rows (nodes) in the model.
int columnCount(const QModelIndex &parent=QModelIndex()) const override
Returns the number of columns. Always returns 1.
Qt::ItemFlags flags(const QModelIndex &index) const override
Returns the item flags for the given index.
void NodePredicateChanged() override
Called when the node predicate has changed. Rebuilds the model data.
std::vector< mitk::DataNode::Pointer > m_DataNodes
void NodeChanged(const mitk::DataNode *node) override
Called when a node in the data storage has changed.
Central node class of the MITK data tree, associating a data object with properties and mappers.
Definition: mitkDataNode.h:72