Medical Imaging Interaction Toolkit  2026.06.00
Medical Imaging Interaction Toolkit
QmitkDoseValueDelegate.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 QmitkDoseValueDelegate_h
14 #define QmitkDoseValueDelegate_h
15 
16 
17 #include <QStyledItemDelegate>
18 
19 #include <MitkRTUIExports.h>
20 
34 class MITKRTUI_EXPORT QmitkDoseValueDelegate : public QStyledItemDelegate
35 {
36  Q_OBJECT
37 
38 public:
43  explicit QmitkDoseValueDelegate(QObject *parent = nullptr);
44 
51  void paint(QPainter *painter, const QStyleOptionViewItem &option
52  , const QModelIndex &index) const override;
53 
65  QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &option
66  , const QModelIndex &index) const override;
67 
73  void setEditorData(QWidget *editor, const QModelIndex &index) const override;
74 
81  void setModelData(QWidget *editor, QAbstractItemModel* model, const QModelIndex &index) const override;
82 };
83 
84 #endif
#define MITKRTUI_EXPORT
Item delegate for rendering and editing dose values in a QTableView.
void setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const override
Commits the edited dose value from the spin box back to the model.
void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override
Renders the dose value text right-aligned in the cell.
QmitkDoseValueDelegate(QObject *parent=nullptr)
Constructor.
QWidget * createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const override
Creates a QDoubleSpinBox editor for editing dose values.
void setEditorData(QWidget *editor, const QModelIndex &index) const override
Populates the editor with the current dose value from the model.