13 #ifndef QmitkDoseValueDelegate_h
14 #define QmitkDoseValueDelegate_h
17 #include <QStyledItemDelegate>
51 void paint(QPainter *painter,
const QStyleOptionViewItem &option
52 ,
const QModelIndex &index)
const override;
65 QWidget *
createEditor(QWidget *parent,
const QStyleOptionViewItem &option
66 ,
const QModelIndex &index)
const override;
73 void setEditorData(QWidget *editor,
const QModelIndex &index)
const override;
81 void setModelData(QWidget *editor, QAbstractItemModel* model,
const QModelIndex &index)
const override;
Item delegate for rendering and editing dose values in a QTableView.
void setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const override
Commits the edited dose value from the spin box back to the model.
void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override
Renders the dose value text right-aligned in the cell.
QmitkDoseValueDelegate(QObject *parent=nullptr)
Constructor.
QWidget * createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const override
Creates a QDoubleSpinBox editor for editing dose values.
void setEditorData(QWidget *editor, const QModelIndex &index) const override
Populates the editor with the current dose value from the model.