Item delegate for rendering and editing the type of a simple barrier constraint.
More...
#include <QmitkSimpleBarrierTypeDelegate.h>
|
| | 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...
|
| |
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.
◆ QmitkSimpleBarrierTypeDelegate()
| QmitkSimpleBarrierTypeDelegate::QmitkSimpleBarrierTypeDelegate |
( |
QObject * |
parent = nullptr | ) |
|
◆ 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] | 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 QmitkSimpleBarrierTypeDelegate::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 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] | 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: