|
Medical Imaging Interaction Toolkit
2026.06.00
Medical Imaging Interaction Toolkit
|
DataStorage model that maintains a history of node selections. More...
#include <QmitkDataStorageHistoryModel.h>


Public Member Functions | |
| QmitkDataStorageHistoryModel (QObject *parent) | |
| Constructs the history model. More... | |
Public Member Functions inherited from QmitkDataStorageDefaultListModel | |
| QmitkDataStorageDefaultListModel (QObject *parent) | |
| Constructs the model. More... | |
| void | DataStorageChanged () override |
| Called when the data storage has changed. Rebuilds the model data. More... | |
| void | NodePredicateChanged () override |
| Called when the node predicate has changed. Rebuilds the model data. More... | |
| void | NodeAdded (const mitk::DataNode *node) override |
| Called when a node is added to the data storage. More... | |
| void | NodeChanged (const mitk::DataNode *node) override |
| Called when a node in the data storage has changed. More... | |
| void | NodeRemoved (const mitk::DataNode *node) override |
| Called when a node is removed from the data storage. More... | |
| QModelIndex | index (int row, int column, const QModelIndex &parent=QModelIndex()) const override |
| Returns the model index for the given row and column. More... | |
| QModelIndex | parent (const QModelIndex &child) const override |
| Returns the parent index. Always returns an invalid index (flat model). More... | |
| int | rowCount (const QModelIndex &parent=QModelIndex()) const override |
| Returns the number of rows (nodes) in the model. More... | |
| int | columnCount (const QModelIndex &parent=QModelIndex()) const override |
| Returns the number of columns. Always returns 1. More... | |
| QVariant | data (const QModelIndex &index, int role=Qt::DisplayRole) const override |
| Returns data for the given index and role. More... | |
| QVariant | headerData (int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const override |
| Returns header data for the given section and orientation. More... | |
| Qt::ItemFlags | flags (const QModelIndex &index) const override |
| Returns the item flags for the given index. More... | |
Public Member Functions inherited from QmitkAbstractDataStorageModel | |
| ~QmitkAbstractDataStorageModel () override | |
| void | SetDataStorage (mitk::DataStorage *dataStorage) |
| Sets the data storage and registers node event listeners. More... | |
| mitk::DataStorage::Pointer | GetDataStorage () const |
| Returns a locked pointer to the current data storage. More... | |
| void | SetNodePredicate (const mitk::NodePredicateBase *nodePredicate) |
| Sets the node predicate and triggers a model update. More... | |
| const mitk::NodePredicateBase * | GetNodePredicate () const |
| Returns the currently set node predicate. More... | |
Static Public Member Functions | |
| static void | AddNodeToHistory (mitk::DataNode *node) |
| Adds a node to the global selection history. More... | |
| static void | ResetHistory () |
| Clears the entire selection history. More... | |
Protected Member Functions | |
| void | UpdateModelData () override |
Protected Member Functions inherited from QmitkAbstractDataStorageModel | |
| QmitkAbstractDataStorageModel (QObject *parent=nullptr) | |
| QmitkAbstractDataStorageModel (mitk::DataStorage *dataStorage, QObject *parent=nullptr) | |
Additional Inherited Members | |
Protected Attributes inherited from QmitkDataStorageDefaultListModel | |
| std::vector< mitk::DataNode::Pointer > | m_DataNodes |
Protected Attributes inherited from QmitkAbstractDataStorageModel | |
| mitk::WeakPointer< mitk::DataStorage > | m_DataStorage |
| mitk::NodePredicateBase::ConstPointer | m_NodePredicate |
DataStorage model that maintains a history of node selections.
This model extends QmitkDataStorageDefaultListModel to present nodes ordered by selection time (LIFO – most recently selected first). The history is maintained as a static list shared across all instances.
Nodes appear in the history only if they satisfy all of the following:
Definition at line 35 of file QmitkDataStorageHistoryModel.h.
| QmitkDataStorageHistoryModel::QmitkDataStorageHistoryModel | ( | QObject * | parent | ) |
Constructs the history model.
| [in] | parent | The parent QObject. |
|
static |
Adds a node to the global selection history.
If the node is already present in the history, the old entry is removed before inserting the node at the front. A nullptr node is silently ignored.
| [in] | node | The data node to add. May be nullptr. |
|
static |
Clears the entire selection history.
|
overrideprotectedvirtual |
Reimplemented from QmitkDataStorageDefaultListModel.