Medical Imaging Interaction Toolkit  2016.11.0
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) University College London (UCL).
6 All rights reserved.
7 
8 This software is distributed WITHOUT ANY WARRANTY; without
9 even the implied warranty of MERCHANTABILITY or FITNESS FOR
10 A PARTICULAR PURPOSE.
11 
12 See LICENSE.txt or http://www.mitk.org for details.
13 
14 ===================================================================*/
15 
16 #ifndef QmitkDataStorageComboBoxWithSelectNone_h
17 #define QmitkDataStorageComboBoxWithSelectNone_h
18 
19 #include <MitkQtWidgetsExports.h>
20 
22 #include "QmitkCustomVariants.h"
23 #include "mitkDataNode.h"
24 
25 
37 {
38 
39  Q_OBJECT
40  Q_PROPERTY(mitkDataNodePtr SelectedNode READ GetSelectedNode WRITE SetSelectedNode)
41  Q_PROPERTY(QString currentValue READ currentValue WRITE setCurrentValue)
42 
43  public:
48  QmitkDataStorageComboBoxWithSelectNone(QWidget* parent = nullptr, bool autoSelectNewNodes=false);
49 
54  QmitkDataStorageComboBoxWithSelectNone( mitk::DataStorage* _DataStorage,
55  const mitk::NodePredicateBase* predicate,
56  QWidget* parent = nullptr,
57  bool autoSelectNewNodes=false);
58 
64 
68  static const QString ZERO_ENTRY_STRING;
69 
75  virtual int Find( const mitk::DataNode* dataNode ) const override;
76 
82  virtual mitk::DataNode::Pointer GetNode(int index) const override;
83 
87  virtual mitk::DataNode::Pointer GetSelectedNode() const override;
88 
92  virtual void SetSelectedNode(const mitk::DataNode::Pointer& node);
93 
94  using QmitkDataStorageComboBox::RemoveNode;
99  virtual void RemoveNode(int index) override;
100 
101  using QmitkDataStorageComboBox::SetNode;
106  virtual void SetNode(int index, const mitk::DataNode* dataNode) override;
107 
111  virtual QString currentValue() const;
112 
116  virtual void setCurrentValue(const QString& path);
117 
121  void SetZeroEntryText(const QString& zeroEntryString);
122 
123  protected:
124 
128  bool HasIndex(unsigned int index) const;
129 
133  virtual void InsertNode(int index, const mitk::DataNode* dataNode) override;
134 
138  virtual void Reset() override;
139 
140  private:
141 
148  QString m_CurrentPath;
149 };
150 
151 #endif // QmitkDataStorageComboBoxWithSelectNone_h
itk::SmartPointer< Self > Pointer
Displays all or a subset (defined by a predicate) of nodes of the Data Storage.
Displays all or a subset (defined by a predicate) of nodes of the Data Storage, and additionally...
DataCollection - Class to facilitate loading/accessing structured data.
#define MITKQTWIDGETS_EXPORT