|
Medical Imaging Interaction Toolkit
2026.06.00
Medical Imaging Interaction Toolkit
|
Item delegate for rendering and editing dose level colors in a QTableView. More...
#include <QmitkDoseColorDelegate.h>


Public Member Functions | |
| QmitkDoseColorDelegate (QObject *parent=nullptr) | |
| Constructor. More... | |
| bool | editorEvent (QEvent *event, QAbstractItemModel *model, const QStyleOptionViewItem &option, const QModelIndex &index) override |
| Handles mouse click events to open a color chooser dialog. More... | |
| void | paint (QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override |
| Paints the cell as a solid rectangle filled with the dose color. More... | |
Item delegate for rendering and editing dose level colors in a QTableView.
This delegate paints a filled rectangle with the dose color and opens a QColorDialog on left-click to allow the user to change the color. It reads and writes color data via the Qt::EditRole.
Definition at line 33 of file QmitkDoseColorDelegate.h.
|
explicit |
Constructor.
| [in] | parent | Optional parent QObject. |
|
override |
Handles mouse click events to open a color chooser dialog.
On left mouse button release, opens a QColorDialog initialized with the current color. If the user selects a valid color, it is written back to the model.
| [in] | event | The event to handle. |
| [in,out] | model | The model to read from and write to. |
| [in] | option | Style options for the item. |
| [in] | index | The model index of the item. |
|
override |
Paints the cell as a solid rectangle filled with the dose color.
| [in] | painter | The QPainter to use for drawing. |
| [in] | option | Style options for the item. |
| [in] | index | The model index of the item to paint. |