Medical Imaging Interaction Toolkit  2018.4.99-389bf124
Medical Imaging Interaction Toolkit
QmitkDoseValueDelegate Class Reference

An item delegate for rendering and editing dose values. The delegate assumes that the model uses the role Qt::UserRole+1 to indicate if the returned dose value is an absolute (data(Qt::UserRole+1) == true) or an relative dose (data(Qt::UserRole+1) == false). More...

#include <QmitkDoseValueDelegate.h>

Inheritance diagram for QmitkDoseValueDelegate:
Collaboration diagram for QmitkDoseValueDelegate:

Public Member Functions

 QmitkDoseValueDelegate (QObject *parent=nullptr)
 
void paint (QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override
 
QWidget * createEditor (QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const override
 
void setEditorData (QWidget *editor, const QModelIndex &index) const override
 
void setModelData (QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const override
 

Detailed Description

An item delegate for rendering and editing dose values. The delegate assumes that the model uses the role Qt::UserRole+1 to indicate if the returned dose value is an absolute (data(Qt::UserRole+1) == true) or an relative dose (data(Qt::UserRole+1) == false).

Definition at line 26 of file QmitkDoseValueDelegate.h.

Constructor & Destructor Documentation

◆ QmitkDoseValueDelegate()

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

Creates a new PropertyDelegate.

Definition at line 20 of file QmitkDoseValueDelegate.cpp.

Member Function Documentation

◆ createEditor()

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

Create an editor for a specific property (overwritten from QItemDelegate)

Definition at line 38 of file QmitkDoseValueDelegate.cpp.

◆ paint()

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

Renders a specific property (overwritten from QItemDelegate)

Definition at line 24 of file QmitkDoseValueDelegate.cpp.

◆ setEditorData()

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

Create an editor for a specific property (overwritten from QItemDelegate)

Definition at line 73 of file QmitkDoseValueDelegate.cpp.

◆ setModelData()

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

When the user accepts input this func commits the data to the model (overwritten from QItemDelegate)

Definition at line 92 of file QmitkDoseValueDelegate.cpp.


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