Item delegate for editing MITK properties in a QTreeView or QTableView.
More...
#include <QmitkPropertyItemDelegate.h>
|
| | QmitkPropertyItemDelegate (QObject *parent=nullptr) |
| | Constructs the delegate. More...
|
| |
| | ~QmitkPropertyItemDelegate () override |
| |
| QWidget * | createEditor (QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const override |
| | Creates a type-appropriate editor widget for the given model index. More...
|
| |
| void | paint (QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override |
| | Paints the item, with special handling for color properties. More...
|
| |
| void | setEditorData (QWidget *editor, const QModelIndex &index) const override |
| | Sets the editor widget data from the model. More...
|
| |
| void | setModelData (QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const override |
| | Writes the editor widget data back to the model. More...
|
| |
| void | SetPropertyList (mitk::PropertyList *propertyList) |
| | Sets the property list whose properties are being edited. More...
|
| |
Item delegate for editing MITK properties in a QTreeView or QTableView.
Creates type-appropriate editor widgets (spin boxes, check boxes, combo boxes, color pickers, line edits) based on the property type. Works with QmitkPropertyItemModel.
- See also
- QmitkPropertyItemModel
-
QmitkPropertyItem
-
QmitkPropertiesTableEditor
Definition at line 112 of file QmitkPropertyItemDelegate.h.
◆ QmitkPropertyItemDelegate()
| QmitkPropertyItemDelegate::QmitkPropertyItemDelegate |
( |
QObject * |
parent = nullptr | ) |
|
|
explicit |
Constructs the delegate.
- Parameters
-
| [in] | parent | Optional parent QObject. |
◆ ~QmitkPropertyItemDelegate()
| QmitkPropertyItemDelegate::~QmitkPropertyItemDelegate |
( |
| ) |
|
|
override |
◆ createEditor()
| QWidget* QmitkPropertyItemDelegate::createEditor |
( |
QWidget * |
parent, |
|
|
const QStyleOptionViewItem & |
option, |
|
|
const QModelIndex & |
index |
|
) |
| const |
|
override |
Creates a type-appropriate editor widget for the given model index.
- Parameters
-
| [in] | parent | The parent widget for the editor. |
| [in] | option | Style options for the item. |
| [in] | index | The model index to create an editor for. |
- Returns
- The created editor widget.
◆ paint()
| void QmitkPropertyItemDelegate::paint |
( |
QPainter * |
painter, |
|
|
const QStyleOptionViewItem & |
option, |
|
|
const QModelIndex & |
index |
|
) |
| const |
|
override |
Paints the item, with special handling for color properties.
- Parameters
-
| [in] | painter | The painter to use. |
| [in] | option | Style options for the item. |
| [in] | index | The model index to paint. |
◆ setEditorData()
| void QmitkPropertyItemDelegate::setEditorData |
( |
QWidget * |
editor, |
|
|
const QModelIndex & |
index |
|
) |
| const |
|
override |
Sets the editor widget data from the model.
- Parameters
-
| [in] | editor | The editor widget. |
| [in] | index | The model index providing the data. |
◆ setModelData()
| void QmitkPropertyItemDelegate::setModelData |
( |
QWidget * |
editor, |
|
|
QAbstractItemModel * |
model, |
|
|
const QModelIndex & |
index |
|
) |
| const |
|
override |
Writes the editor widget data back to the model.
- Parameters
-
| [in] | editor | The editor widget. |
| [in] | model | The model to write to. |
| [in] | index | The model index to update. |
◆ SetPropertyList()
Sets the property list whose properties are being edited.
- Parameters
-
| [in] | propertyList | The property list to associate with this delegate. |
The documentation for this class was generated from the following file: