Item delegate for rendering and editing label colors in a QmitkMultiLabelTreeView.
More...
#include <QmitkLabelColorItemDelegate.h>
|
| | QmitkLabelColorItemDelegate (QObject *parent=nullptr) |
| | Constructs the color item delegate. More...
|
| |
| bool | editorEvent (QEvent *event, QAbstractItemModel *model, const QStyleOptionViewItem &option, const QModelIndex &index) override |
| | Handles mouse events for opening the color picker dialog. More...
|
| |
| void | paint (QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override |
| | Paints the label color as a filled rectangle. More...
|
| |
Item delegate for rendering and editing label colors in a QmitkMultiLabelTreeView.
Renders the label color as a filled rectangle in the color column and handles mouse click events to open a color picker dialog for changing the label color.
- See also
- QmitkMultiLabelTreeView
-
QmitkMultiLabelTreeModel
-
QmitkLabelToggleItemDelegate
Definition at line 31 of file QmitkLabelColorItemDelegate.h.
◆ QmitkLabelColorItemDelegate()
| QmitkLabelColorItemDelegate::QmitkLabelColorItemDelegate |
( |
QObject * |
parent = nullptr | ) |
|
|
explicit |
Constructs the color item delegate.
- Parameters
-
| [in] | parent | Optional parent QObject. |
◆ editorEvent()
| bool QmitkLabelColorItemDelegate::editorEvent |
( |
QEvent * |
event, |
|
|
QAbstractItemModel * |
model, |
|
|
const QStyleOptionViewItem & |
option, |
|
|
const QModelIndex & |
index |
|
) |
| |
|
override |
Handles mouse events for opening the color picker dialog.
- Parameters
-
| [in] | event | The editor event. |
| [in] | model | The model being edited. |
| [in] | option | The style option for the item. |
| [in] | index | The model index of the item. |
- Returns
- True if the event was handled; false otherwise.
◆ paint()
| void QmitkLabelColorItemDelegate::paint |
( |
QPainter * |
painter, |
|
|
const QStyleOptionViewItem & |
option, |
|
|
const QModelIndex & |
index |
|
) |
| const |
|
override |
Paints the label color as a filled rectangle.
- Parameters
-
| [in] | painter | The painter used for rendering. |
| [in] | option | The style option for the item. |
| [in] | index | The model index of the item. |
The documentation for this class was generated from the following file: