Abstract base class for widgets that inspect the contents of a DataStorage.
More...
#include <QmitkAbstractDataStorageInspector.h>
|
| using | NodeList = QList< mitk::DataNode::Pointer > |
| | Convenience type alias for a list of data node pointers. More...
|
| |
| using | SelectionMode = QAbstractItemView::SelectionMode |
| | Convenience type alias for the Qt selection mode. More...
|
| |
Abstract base class for widgets that inspect the contents of a DataStorage.
This class provides a convenient foundation for implementing widgets that present a specific view onto a given mitk::DataStorage instance and allow the user to inspect and select data nodes. Subclasses must implement Initialize(), GetView(), SetSelectionMode(), and GetSelectionMode().
The inspector uses a QmitkModelViewSelectionConnector internally to manage the translation between data node selections and Qt model/view selections.
- See also
- QmitkModelViewSelectionConnector
-
QmitkDataStorageListInspector
-
QmitkDataStorageTreeInspector
-
mitkIDataStorageInspectorProvider
Definition at line 43 of file QmitkAbstractDataStorageInspector.h.
◆ NodeList
◆ SelectionMode
◆ ~QmitkAbstractDataStorageInspector()
| QmitkAbstractDataStorageInspector::~QmitkAbstractDataStorageInspector |
( |
| ) |
|
|
override |
◆ QmitkAbstractDataStorageInspector()
| QmitkAbstractDataStorageInspector::QmitkAbstractDataStorageInspector |
( |
QWidget * |
parent = nullptr | ) |
|
|
protected |
◆ CurrentSelectionChanged
| void QmitkAbstractDataStorageInspector::CurrentSelectionChanged |
( |
NodeList |
nodes | ) |
|
|
signal |
Emitted when the set of selected nodes has changed.
- Parameters
-
| [in] | nodes | The newly selected data nodes. |
◆ GetNodePredicate()
Returns the currently set node predicate.
- Returns
- Pointer to the current node predicate, or nullptr if none is set.
◆ GetSelectedNodes()
| NodeList QmitkAbstractDataStorageInspector::GetSelectedNodes |
( |
| ) |
const |
Returns the list of currently selected data nodes.
- Returns
- A NodeList containing the currently selected nodes.
◆ GetSelectionMode()
| virtual SelectionMode QmitkAbstractDataStorageInspector::GetSelectionMode |
( |
| ) |
const |
|
pure virtual |
◆ GetSelectOnlyVisibleNodes()
| bool QmitkAbstractDataStorageInspector::GetSelectOnlyVisibleNodes |
( |
| ) |
const |
◆ GetView() [1/2]
| virtual const QAbstractItemView* QmitkAbstractDataStorageInspector::GetView |
( |
| ) |
const |
|
pure virtual |
◆ GetView() [2/2]
| virtual QAbstractItemView* QmitkAbstractDataStorageInspector::GetView |
( |
| ) |
|
|
pure virtual |
◆ Initialize()
| virtual void QmitkAbstractDataStorageInspector::Initialize |
( |
| ) |
|
|
protectedpure virtual |
◆ OnSelectionChanged
| void QmitkAbstractDataStorageInspector::OnSelectionChanged |
( |
NodeList |
selectedNodes | ) |
|
|
protectedslot |
◆ SetCurrentSelection
| void QmitkAbstractDataStorageInspector::SetCurrentSelection |
( |
NodeList |
selectedNodes | ) |
|
|
slot |
Sets the given list of data nodes as the new selection.
Transforms the list of data nodes into a model selection and applies it to the internal item view's selection model. The list is filtered according to the current selectOnlyVisibleNodes setting. When that setting is false, non-visible nodes are stored internally and merged into any outgoing selection signal.
- Parameters
-
| [in] | selectedNodes | The data nodes to select. |
- See also
- SetSelectOnlyVisibleNodes
◆ SetDataStorage()
| void QmitkAbstractDataStorageInspector::SetDataStorage |
( |
mitk::DataStorage * |
dataStorage | ) |
|
Sets the data storage that will be used and monitored by this widget.
If the new data storage differs from the current one and is not null, the widget is re-initialized via Initialize().
- Parameters
-
| [in] | dataStorage | Pointer to the data storage to set. May be nullptr. |
◆ SetNodePredicate()
Sets the node predicate and re-initializes the widget accordingly.
The predicate is used to filter the nodes shown in the inspector view. If the predicate changes, the widget is re-initialized via Initialize().
- Parameters
-
| [in] | nodePredicate | Pointer to the node predicate. May be nullptr to show all nodes. |
Reimplemented in QmitkDataStorageFavoriteNodesInspector.
◆ SetSelectionMode()
| virtual void QmitkAbstractDataStorageInspector::SetSelectionMode |
( |
SelectionMode |
mode | ) |
|
|
pure virtual |
◆ SetSelectOnlyVisibleNodes
| void QmitkAbstractDataStorageInspector::SetSelectOnlyVisibleNodes |
( |
bool |
selectOnlyVisibleNodes | ) |
|
|
slot |
Controls whether selections are restricted to visible nodes only.
If selectOnlyVisibleNodes is true, an incoming selection will be filtered (reduced) to only those nodes that are currently visible in the view. An outgoing selection can then at most contain these visible nodes.
If false, non-visible nodes from an incoming selection are stored internally and included in outgoing selections, preserving the original selection even though those nodes cannot be interactively (de-)selected in the view.
- Parameters
-
| [in] | selectOnlyVisibleNodes | If true, only visible nodes may be selected. |
- See also
- GetSelectOnlyVisibleNodes
◆ m_Connector
◆ m_DataStorage
◆ m_NodePredicate
| mitk::NodePredicateBase::ConstPointer QmitkAbstractDataStorageInspector::m_NodePredicate |
|
protected |
The documentation for this class was generated from the following file: