Medical Imaging Interaction Toolkit  2018.4.99-389bf124
Medical Imaging Interaction Toolkit
QmitkNDIToolDelegate.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 QmitkNDIToolDelegate_h
14 #define QmitkNDIToolDelegate_h
15 
17 #include "MitkIGTUIExports.h"
18 #include "mitkNodePredicateBase.h"
19 #include "mitkBaseProperty.h"
21 #include <QStyledItemDelegate>
22 
24 namespace mitk
25 {
26  class DataStorage;
27  class NodePredicateBase;
28  class BaseProperty;
29 };
30 
35 class MITKIGTUI_EXPORT QmitkNDIToolDelegate : public QStyledItemDelegate
36 {
37  Q_OBJECT
38 
39  public:
43  QmitkNDIToolDelegate(QObject *parent = nullptr);
44 
46  {
47  IndexCol = 0,
53  RepCol
54  };
56  {
57  NDIToolRole = 70,
61  TypeRole
62  };
63 
64 
65  void SetTypes(const QStringList& types);
66  void SetDataStorage(mitk::DataStorage* ds);
67  void SetPredicate(mitk::NodePredicateBase::Pointer p);
68  void SetTagPropertyName(const std::string& name);
69  void SetTagProperty(mitk::BaseProperty::Pointer prop);
70 
74  //void paint(QPainter *painter, const QStyleOptionViewItem &option
75  // , const QModelIndex &index) const;
76 
80  QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &option
81  , const QModelIndex &index) const override;
82 
86  void setEditorData(QWidget *editor, const QModelIndex &index) const override;
87 
91  void setModelData(QWidget *editor, QAbstractItemModel* model
92  , const QModelIndex &index) const override;
93 
97  //void updateEditorGeometry(QWidget *editor, const QStyleOptionViewItem &option, const QModelIndex &index) const;
98 
99  private slots:
103  void commitAndCloseEditor();
104  void ComboBoxCurrentIndexChanged ( int index ) ;
105 
106 
107 private:
108  QStringList m_Types;
111  mitk::BaseProperty::Pointer m_TagProperty;
112  std::string m_TagPropertyName;
113 };
114 #endif /* QmitkNDIToolDelegate_h */
Data management class that handles &#39;was created by&#39; relations.
DataCollection - Class to facilitate loading/accessing structured data.
An item delegate for rendering and editing mitk::Properties in a QTableView.
mitk::DataStorage::Pointer m_DataStorage