Medical Imaging Interaction Toolkit  2026.06.00
Medical Imaging Interaction Toolkit
QmitkDoseColorDelegate.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 QmitkDoseColorDelegate_h
14 #define QmitkDoseColorDelegate_h
15 
16 
17 #include <QStyledItemDelegate>
18 
19 #include <MitkRTUIExports.h>
20 
33 class MITKRTUI_EXPORT QmitkDoseColorDelegate : public QStyledItemDelegate
34 {
35  Q_OBJECT
36 
37 public:
42  explicit QmitkDoseColorDelegate(QObject *parent = nullptr);
43 
56  bool editorEvent(QEvent *event, QAbstractItemModel *model, const QStyleOptionViewItem &option,
57  const QModelIndex &index) override;
58 
65  void paint(QPainter *painter, const QStyleOptionViewItem &option,
66  const QModelIndex &index) const override;
67 };
68 
69 #endif
#define MITKRTUI_EXPORT
Item delegate for rendering and editing dose level colors in a QTableView.
bool editorEvent(QEvent *event, QAbstractItemModel *model, const QStyleOptionViewItem &option, const QModelIndex &index) override
Handles mouse click events to open a color chooser dialog.
QmitkDoseColorDelegate(QObject *parent=nullptr)
Constructor.
void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override
Paints the cell as a solid rectangle filled with the dose color.