Medical Imaging Interaction Toolkit  2026.06.00
Medical Imaging Interaction Toolkit
QmitkPropertyItemDelegate Class Reference

Item delegate for editing MITK properties in a QTreeView or QTableView. More...

#include <QmitkPropertyItemDelegate.h>

Inheritance diagram for QmitkPropertyItemDelegate:
Collaboration diagram for QmitkPropertyItemDelegate:

Public Member Functions

 QmitkPropertyItemDelegate (QObject *parent=nullptr)
 Constructs the delegate. More...
 
 ~QmitkPropertyItemDelegate () override
 
QWidget * createEditor (QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const override
 Creates a type-appropriate editor widget for the given model index. More...
 
void paint (QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override
 Paints the item, with special handling for color properties. More...
 
void setEditorData (QWidget *editor, const QModelIndex &index) const override
 Sets the editor widget data from the model. More...
 
void setModelData (QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const override
 Writes the editor widget data back to the model. More...
 
void SetPropertyList (mitk::PropertyList *propertyList)
 Sets the property list whose properties are being edited. More...
 

Detailed Description

Item delegate for editing MITK properties in a QTreeView or QTableView.

Creates type-appropriate editor widgets (spin boxes, check boxes, combo boxes, color pickers, line edits) based on the property type. Works with QmitkPropertyItemModel.

See also
QmitkPropertyItemModel
QmitkPropertyItem
QmitkPropertiesTableEditor

Definition at line 112 of file QmitkPropertyItemDelegate.h.

Constructor & Destructor Documentation

◆ QmitkPropertyItemDelegate()

QmitkPropertyItemDelegate::QmitkPropertyItemDelegate ( QObject *  parent = nullptr)
explicit

Constructs the delegate.

Parameters
[in]parentOptional parent QObject.

◆ ~QmitkPropertyItemDelegate()

QmitkPropertyItemDelegate::~QmitkPropertyItemDelegate ( )
override

Member Function Documentation

◆ createEditor()

QWidget* QmitkPropertyItemDelegate::createEditor ( QWidget *  parent,
const QStyleOptionViewItem &  option,
const QModelIndex &  index 
) const
override

Creates a type-appropriate editor widget for the given model index.

Parameters
[in]parentThe parent widget for the editor.
[in]optionStyle options for the item.
[in]indexThe model index to create an editor for.
Returns
The created editor widget.

◆ paint()

void QmitkPropertyItemDelegate::paint ( QPainter *  painter,
const QStyleOptionViewItem &  option,
const QModelIndex &  index 
) const
override

Paints the item, with special handling for color properties.

Parameters
[in]painterThe painter to use.
[in]optionStyle options for the item.
[in]indexThe model index to paint.

◆ setEditorData()

void QmitkPropertyItemDelegate::setEditorData ( QWidget *  editor,
const QModelIndex &  index 
) const
override

Sets the editor widget data from the model.

Parameters
[in]editorThe editor widget.
[in]indexThe model index providing the data.

◆ setModelData()

void QmitkPropertyItemDelegate::setModelData ( QWidget *  editor,
QAbstractItemModel *  model,
const QModelIndex &  index 
) const
override

Writes the editor widget data back to the model.

Parameters
[in]editorThe editor widget.
[in]modelThe model to write to.
[in]indexThe model index to update.

◆ SetPropertyList()

void QmitkPropertyItemDelegate::SetPropertyList ( mitk::PropertyList *  propertyList)

Sets the property list whose properties are being edited.

Parameters
[in]propertyListThe property list to associate with this delegate.

The documentation for this class was generated from the following file: