Medical Imaging Interaction Toolkit  2026.06.00
Medical Imaging Interaction Toolkit
QmitkSimpleBarrierTypeDelegate Class Reference

Item delegate for rendering and editing the type of a simple barrier constraint. More...

#include <QmitkSimpleBarrierTypeDelegate.h>

Inheritance diagram for QmitkSimpleBarrierTypeDelegate:
Collaboration diagram for QmitkSimpleBarrierTypeDelegate:

Public Member Functions

 QmitkSimpleBarrierTypeDelegate (QObject *parent=nullptr)
 Constructs a QmitkSimpleBarrierTypeDelegate. More...
 
QWidget * createEditor (QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const override
 Creates a QComboBox editor with "lower" and "upper" options. More...
 
void setEditorData (QWidget *editor, const QModelIndex &index) const override
 Sets the combo box selection to match the current model data. More...
 
void setModelData (QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const override
 Transfers the selected constraint type index from the combo box back to the model. More...
 

Detailed Description

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

This delegate provides a QComboBox editor allowing the user to choose between "lower" (type 0) and "upper" (type 1) barrier constraint types. The type is encoded as an integer in the model data via the Qt::EditRole.

See also
QmitkSimpleBarrierModel
QmitkSimpleBarrierManagerWidget

Definition at line 33 of file QmitkSimpleBarrierTypeDelegate.h.

Constructor & Destructor Documentation

◆ QmitkSimpleBarrierTypeDelegate()

QmitkSimpleBarrierTypeDelegate::QmitkSimpleBarrierTypeDelegate ( QObject *  parent = nullptr)

Constructs a QmitkSimpleBarrierTypeDelegate.

Parameters
[in]parentOptional parent QObject.

Member Function Documentation

◆ createEditor()

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

Creates a QComboBox editor with "lower" and "upper" options.

If the model data for the index 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.

◆ setEditorData()

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

Sets the combo box selection to match the current model data.

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

◆ setModelData()

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

Transfers the selected constraint type index from the combo box back to the model.

Parameters
[in]editorThe editor widget containing the selection.
[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: