Medical Imaging Interaction Toolkit  2024.12.00
Medical Imaging Interaction Toolkit
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
QmitkDataStorageComboBoxWithSelectNone.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 QmitkDataStorageComboBoxWithSelectNone_h
14 #define QmitkDataStorageComboBoxWithSelectNone_h
15 
16 #include <MitkQtWidgetsExports.h>
17 
19 #include "QmitkCustomVariants.h"
20 #include "mitkDataNode.h"
21 
22 
33 {
34 
35  Q_OBJECT
36  Q_PROPERTY(mitkDataNodePtr SelectedNode READ GetSelectedNode WRITE SetSelectedNode)
37  Q_PROPERTY(QString currentValue READ currentValue WRITE setCurrentValue)
38 
39  public:
44  QmitkDataStorageComboBoxWithSelectNone(QWidget* parent = nullptr, bool autoSelectNewNodes=false);
45 
50  QmitkDataStorageComboBoxWithSelectNone( mitk::DataStorage* dataStorage,
51  const mitk::NodePredicateBase* predicate,
52  QWidget* parent = nullptr,
53  bool autoSelectNewNodes = false);
54 
60 
64  static const QString ZERO_ENTRY_STRING;
65 
71  int Find(const mitk::DataNode* dataNode) const override;
72 
78  mitk::DataNode::Pointer GetNode(int index) const override;
79 
83  mitk::DataNode::Pointer GetSelectedNode() const override;
84 
88  virtual void SetSelectedNode(const mitk::DataNode::Pointer& node);
89 
90  using QmitkDataStorageComboBox::RemoveNode;
95  void RemoveNode(int index) override;
96 
97  using QmitkDataStorageComboBox::SetNode;
102  void SetNode(int index, const mitk::DataNode* dataNode) override;
103 
107  virtual QString currentValue() const;
108 
112  virtual void setCurrentValue(const QString& path);
113 
117  void SetZeroEntryText(const QString& zeroEntryString);
118 
119  protected:
120 
124  bool HasIndex(unsigned int index) const;
125 
129  void InsertNode(int index, const mitk::DataNode* dataNode) override;
130 
134  void Reset() override;
135 
136  private:
137 
144  QString m_CurrentPath;
145 };
146 
147 #endif
MITKQTWIDGETS_EXPORT
#define MITKQTWIDGETS_EXPORT
Definition: MitkQtWidgetsExports.h:15
itk::SmartPointer< Self >
mitk
Find image slices visible on a given plane.
Definition: RenderingTests.dox:1
MitkQtWidgetsExports.h
QmitkDataStorageComboBox.h
mitkDataNode.h
QmitkDataStorageComboBox
Displays all or a subset (defined by a predicate) of nodes of the Data Storage.
Definition: QmitkDataStorageComboBox.h:38
QmitkDataStorageComboBoxWithSelectNone
Displays all or a subset (defined by a predicate) of nodes of the Data Storage, and additionally,...
Definition: QmitkDataStorageComboBoxWithSelectNone.h:32
QmitkCustomVariants.h