Medical Imaging Interaction Toolkit  2023.12.00
Medical Imaging Interaction Toolkit
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 
34 {
35 
36  Q_OBJECT
37  Q_PROPERTY(mitkDataNodePtr SelectedNode READ GetSelectedNode WRITE SetSelectedNode)
38  Q_PROPERTY(QString currentValue READ currentValue WRITE setCurrentValue)
39 
40  public:
45  QmitkDataStorageComboBoxWithSelectNone(QWidget* parent = nullptr, bool autoSelectNewNodes=false);
46 
51  QmitkDataStorageComboBoxWithSelectNone( mitk::DataStorage* dataStorage,
52  const mitk::NodePredicateBase* predicate,
53  QWidget* parent = nullptr,
54  bool autoSelectNewNodes = false);
55 
61 
65  static const QString ZERO_ENTRY_STRING;
66 
72  int Find(const mitk::DataNode* dataNode) const override;
73 
79  mitk::DataNode::Pointer GetNode(int index) const override;
80 
84  mitk::DataNode::Pointer GetSelectedNode() const override;
85 
89  virtual void SetSelectedNode(const mitk::DataNode::Pointer& node);
90 
91  using QmitkDataStorageComboBox::RemoveNode;
96  void RemoveNode(int index) override;
97 
98  using QmitkDataStorageComboBox::SetNode;
103  void SetNode(int index, const mitk::DataNode* dataNode) override;
104 
108  virtual QString currentValue() const;
109 
113  virtual void setCurrentValue(const QString& path);
114 
118  void SetZeroEntryText(const QString& zeroEntryString);
119 
120  protected:
121 
125  bool HasIndex(unsigned int index) const;
126 
130  void InsertNode(int index, const mitk::DataNode* dataNode) override;
131 
135  void Reset() override;
136 
137  private:
138 
145  QString m_CurrentPath;
146 };
147 
148 #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:33
QmitkCustomVariants.h