Medical Imaging Interaction Toolkit  2024.06.99-60d9b802
Medical Imaging Interaction Toolkit
QmitkPropertyDelegate.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 QmitkPropertyDelegate_h
14 #define QmitkPropertyDelegate_h
15 
16 #include <MitkQtWidgetsExports.h>
17 
19 #include "mitkBaseProperty.h"
20 
22 #include <QStyledItemDelegate>
23 
25 
32 class MITKQTWIDGETS_EXPORT QmitkPropertyDelegate : public QStyledItemDelegate
33 {
34  Q_OBJECT
35 
36 public:
40  QmitkPropertyDelegate(QObject *parent = nullptr);
41 
45  void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override;
46 
50  QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const override;
51 
55  void setEditorData(QWidget *editor, const QModelIndex &index) const override;
56 
60  void setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const override;
61 
65  void updateEditorGeometry(QWidget *editor,
66  const QStyleOptionViewItem &option,
67  const QModelIndex &index) const override;
68 
69 protected:
70  bool eventFilter(QObject *o, QEvent *e) override;
71 
72 private slots:
76  void commitAndCloseEditor();
77  void showColorDialog();
78  void ComboBoxCurrentIndexChanged(int index);
79  void SpinBoxValueChanged(const QString &value);
80 };
81 
82 #endif
MITKQTWIDGETS_EXPORT
#define MITKQTWIDGETS_EXPORT
Definition: MitkQtWidgetsExports.h:15
QmitkPropertyDelegate
Own includes.
Definition: QmitkPropertyDelegate.h:32
MitkQtWidgetsExports.h
mitkBaseProperty.h