MITK-IGT
IGT Extension of MITK
Loading...
Searching...
No Matches
QmitkNDIToolDelegate.h
Go to the documentation of this file.
1/*============================================================================
2
3The Medical Imaging Interaction Toolkit (MITK)
4
5Copyright (c) German Cancer Research Center (DKFZ)
6All rights reserved.
7
8Use of this source code is governed by a 3-clause BSD license that can be
9found 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
24namespace mitk
25{
26 class DataStorage;
27 class NodePredicateBase;
28 class BaseProperty;
29};
30
35class MITKIGTUI_EXPORT QmitkNDIToolDelegate : public QStyledItemDelegate
36{
37 Q_OBJECT
38
39 public:
43 QmitkNDIToolDelegate(QObject *parent = nullptr);
44
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
107private:
108 QStringList m_Types;
109 mitk::DataStorage* m_DataStorage;
110 mitk::NodePredicateBase::Pointer m_Predicate;
111 mitk::BaseProperty::Pointer m_TagProperty;
112 std::string m_TagPropertyName;
113};
114#endif
An item delegate for rendering and editing mitk::Properties in a QTableView.
IGT Exceptions.