Toolkit includes.
More...
#include <QmitkInitialValuesDelegate.h>
|
| int | valueType (const QModelIndex &index) const |
| | Determines the value type for the given index. More...
|
| |
|
| mitk::DataStorage::Pointer | m_Storage |
| | Data storage used as source for potential initial value images. More...
|
| |
| mitk::NodePredicateBase::Pointer | m_Predicate |
| | Predicate used to filter for valid initial value images in the data storage. More...
|
| |
Toolkit includes.
Item delegate for rendering and editing the initial value source of a model parameter.
This delegate supports two value types determined by the Qt::UserRole data of the index:
- Type 0 (scalar): The edit role data is a double, and a standard spin box editor is used.
- Type 1 (image): The edit role data is a void pointer to a mitk::DataNode. A QmitkDataStorageComboBox is used to select an image node from the configured data storage.
- See also
- QmitkInitialValuesModel
-
QmitkInitialValuesTypeDelegate
-
QmitkInitialValuesManagerWidget
Definition at line 39 of file QmitkInitialValuesDelegate.h.
◆ QmitkInitialValuesDelegate()
| QmitkInitialValuesDelegate::QmitkInitialValuesDelegate |
( |
QObject * |
parent = nullptr | ) |
|
◆ createEditor()
| QWidget* QmitkInitialValuesDelegate::createEditor |
( |
QWidget * |
parent, |
|
|
const QStyleOptionViewItem & |
option, |
|
|
const QModelIndex & |
index |
|
) |
| const |
|
override |
Creates an appropriate editor widget based on the value type.
For scalar types (type 0), delegates to QStyledItemDelegate::createEditor(). For image types (type 1), creates a QmitkDataStorageComboBox filtered by the configured node predicate.
- 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.
◆ setDataStorage()
Sets the data storage used to populate the image selection combo box.
- Parameters
-
| [in] | storage | Pointer to the DataStorage instance. |
◆ setEditorData()
| void QmitkInitialValuesDelegate::setEditorData |
( |
QWidget * |
editor, |
|
|
const QModelIndex & |
index |
|
) |
| const |
|
override |
Populates the editor with data from the model.
For scalar types, delegates to QStyledItemDelegate. For image types, finds and selects the corresponding data node in the combo box.
- Parameters
-
| [in] | editor | The editor widget to populate. |
| [in] | index | The model index of the item. |
◆ setModelData()
| void QmitkInitialValuesDelegate::setModelData |
( |
QWidget * |
editor, |
|
|
QAbstractItemModel * |
model, |
|
|
const QModelIndex & |
index |
|
) |
| const |
|
override |
Transfers data from the editor back to the model.
For image types, stores the selected data node pointer. For scalar types, delegates to QStyledItemDelegate.
- Parameters
-
| [in] | editor | The editor widget containing the new value. |
| [in,out] | model | The abstract item model to update. |
| [in] | index | The model index of the item. |
◆ setNodePredicate()
Sets the node predicate used to filter images in the data storage.
- Parameters
-
| [in] | predicate | Pointer to the predicate for filtering valid initial value images. |
◆ valueType()
| int QmitkInitialValuesDelegate::valueType |
( |
const QModelIndex & |
index | ) |
const |
|
protected |
Determines the value type for the given index.
- Parameters
-
| [in] | index | The model index to query (uses Qt::UserRole data). |
- Returns
- 0 for scalar type, 1 for image type.
◆ m_Predicate
| mitk::NodePredicateBase::Pointer QmitkInitialValuesDelegate::m_Predicate |
|
protected |
◆ m_Storage
| mitk::DataStorage::Pointer QmitkInitialValuesDelegate::m_Storage |
|
protected |
The documentation for this class was generated from the following file: