Medical Imaging Interaction Toolkit  2026.06.00
Medical Imaging Interaction Toolkit
QmitkSimpleBarrierParametersDelegate Class Reference

Toolkit includes. More...

#include <QmitkSimpleBarrierParametersDelegate.h>

Inheritance diagram for QmitkSimpleBarrierParametersDelegate:
Collaboration diagram for QmitkSimpleBarrierParametersDelegate:

Public Member Functions

 QmitkSimpleBarrierParametersDelegate (QObject *parent=nullptr)
 Constructs a QmitkSimpleBarrierParametersDelegate. More...
 
void paint (QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override
 Paints the selected parameter names as a comma-separated string. More...
 
QWidget * createEditor (QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const override
 Creates a QListWidget editor with checkable parameter name items. More...
 
void setEditorData (QWidget *editor, const QModelIndex &index) const override
 Populates the list widget with parameter names, checking currently selected ones. More...
 
void setModelData (QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const override
 Transfers the checked parameter names from the list widget back to the model. More...
 

Detailed Description

Toolkit includes.

Item delegate for rendering and editing the parameters of a barrier constraint.

This delegate handles the display and selection of parameters relevant to a barrier constraint. It assumes the following data conventions:

  • Qt::EditRole data is a QStringList of all available parameter names.
  • Qt::DisplayRole data is a QStringList of the currently selected parameter names.

The editor is a QListWidget with checkboxes, allowing multi-selection of parameters. When data is transferred back to the model, a QStringList of all checked parameter names is written.

See also
QmitkSimpleBarrierModel
QmitkSimpleBarrierManagerWidget

Definition at line 39 of file QmitkSimpleBarrierParametersDelegate.h.

Constructor & Destructor Documentation

◆ QmitkSimpleBarrierParametersDelegate()

QmitkSimpleBarrierParametersDelegate::QmitkSimpleBarrierParametersDelegate ( QObject *  parent = nullptr)

Constructs a QmitkSimpleBarrierParametersDelegate.

Parameters
[in]parentOptional parent QObject.

Member Function Documentation

◆ createEditor()

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

Creates a QListWidget editor with checkable parameter name items.

If the edit role data is invalid, returns a read-only QLabel instead.

Parameters
[in]parentThe parent widget for the editor.
[in]optionStyle options for the item.
[in]indexThe model index of the item being edited.
Returns
The newly created editor widget.

◆ paint()

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

Paints the selected parameter names as a comma-separated string.

If the display data is invalid, renders "Invalid data".

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

◆ setEditorData()

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

Populates the list widget with parameter names, checking currently selected ones.

Uses the edit role data for the full list and the display role data for checked items.

Parameters
[in]editorThe editor widget (expected to be a QListWidget).
[in]indexThe model index of the item.

◆ setModelData()

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

Transfers the checked parameter names from the list widget back to the model.

Parameters
[in]editorThe editor widget containing the selections.
[in,out]modelThe abstract item model to update.
[in]indexThe model index of the item.

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