Item delegate for rendering and editing the type of an initial parameter value.
More...
#include <QmitkInitialValuesTypeDelegate.h>
|
| | QmitkInitialValuesTypeDelegate (QObject *parent=nullptr) |
| | Constructs a QmitkInitialValuesTypeDelegate. More...
|
| |
| QWidget * | createEditor (QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const override |
| | Creates a QComboBox editor with "scalar" and "image" 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 type index from the combo box back to the model. More...
|
| |
Item delegate for rendering and editing the type of an initial parameter value.
This delegate provides a QComboBox editor allowing the user to switch between "scalar" (type 0) and "image" (type 1) as the source type for a model parameter's initial value. The type is encoded as an integer in the model data via the Qt::EditRole.
- See also
- QmitkInitialValuesModel
-
QmitkInitialValuesDelegate
-
QmitkInitialValuesManagerWidget
Definition at line 34 of file QmitkInitialValuesTypeDelegate.h.
◆ QmitkInitialValuesTypeDelegate()
| QmitkInitialValuesTypeDelegate::QmitkInitialValuesTypeDelegate |
( |
QObject * |
parent = nullptr | ) |
|
◆ createEditor()
| QWidget* QmitkInitialValuesTypeDelegate::createEditor |
( |
QWidget * |
parent, |
|
|
const QStyleOptionViewItem & |
option, |
|
|
const QModelIndex & |
index |
|
) |
| const |
|
override |
Creates a QComboBox editor with "scalar" and "image" options.
If the model data for the index is invalid, returns a read-only QLabel instead.
- Parameters
-
| [in] | parent | The parent widget for the editor. |
| [in] | option | Style options for the item. |
| [in] | index | The model index of the item being edited. |
- Returns
- The newly created editor widget.
◆ setEditorData()
| void QmitkInitialValuesTypeDelegate::setEditorData |
( |
QWidget * |
editor, |
|
|
const QModelIndex & |
index |
|
) |
| const |
|
override |
Sets the combo box selection to match the current model data.
- Parameters
-
| [in] | editor | The editor widget (expected to be a QComboBox). |
| [in] | index | The model index of the item. |
◆ setModelData()
| void QmitkInitialValuesTypeDelegate::setModelData |
( |
QWidget * |
editor, |
|
|
QAbstractItemModel * |
model, |
|
|
const QModelIndex & |
index |
|
) |
| const |
|
override |
Transfers the selected type index from the combo box back to the model.
- Parameters
-
| [in] | editor | The editor widget containing the selection. |
| [in,out] | model | The abstract item model to update. |
| [in] | index | The model index of the item. |
The documentation for this class was generated from the following file: