Medical Imaging Interaction Toolkit  2026.06.00
Medical Imaging Interaction Toolkit
QmitkMultiNodeSelectionWidget.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 QmitkMultiNodeSelectionWidget_h
14 #define QmitkMultiNodeSelectionWidget_h
15 
16 #include <MitkQtWidgetsExports.h>
17 
18 #include <mitkDataStorage.h>
19 #include <mitkWeakPointer.h>
20 #include <mitkNodePredicateBase.h>
21 
24 #include <memory>
25 
27 
28 namespace Ui
29 {
31 }
32 
38 {
39  Q_OBJECT
40 
41 public:
42  explicit QmitkMultiNodeSelectionWidget(QWidget* parent = nullptr);
44 
46 
53  using SelectionCheckFunctionType = std::function<std::string(const NodeList &)>;
61 
64 
65 Q_SIGNALS:
66  void DialogClosed();
67 
68 public Q_SLOTS:
70 
71 protected Q_SLOTS:
72  void OnClearSelection(const mitk::DataNode* node);
73 
74 protected:
75  void changeEvent(QEvent *event) override;
76 
77  void UpdateInfo() override;
78  void OnInternalSelectionChanged() override;
79 
80  bool AllowEmissionOfSelection(const NodeList& emissionCandidates) const override;
81 
83 
85  mutable std::string m_CheckResponse;
86 
87  std::unique_ptr<Ui::QmitkMultiNodeSelectionWidget> m_Controls;
88 };
89 
90 #endif
#define MITKQTWIDGETS_EXPORT
Abstract base class extending QAbstractItemModel for DataStorage-backed models.
Abstract base class for the selection of data from a data storage.
QList< mitk::DataNode::Pointer > NodeList
Widget that allows to perform and represents a multiple node selection.
void changeEvent(QEvent *event) override
bool AllowEmissionOfSelection(const NodeList &emissionCandidates) const override
~QmitkMultiNodeSelectionWidget() override
void SetSelectionCheckFunction(const SelectionCheckFunctionType &checkFunction)
A selection check function can be set. If set the widget uses this function to check the made/set sel...
QmitkSimpleTextOverlayWidget * m_Overlay
QmitkMultiNodeSelectionWidget(QWidget *parent=nullptr)
std::function< std::string(const NodeList &)> SelectionCheckFunctionType
Helper function that is used to check the given selection for consistency. Returning an empty string ...
SelectionCheckFunctionType m_CheckFunction
bool CurrentSelectionViolatesCheckFunction() const
void OnClearSelection(const mitk::DataNode *node)
void OnInternalSelectionChanged() override
std::unique_ptr< Ui::QmitkMultiNodeSelectionWidget > m_Controls
Central node class of the MITK data tree, associating a data object with properties and mappers.
Definition: mitkDataNode.h:72