13 #ifndef QmitkPropertyItemDelegate_h
14 #define QmitkPropertyItemDelegate_h
18 #include <QStyledItemDelegate>
64 void OnButtonClicked();
65 void OnLineEditEditingFinished();
69 QLineEdit *m_LineEdit;
70 QToolButton *m_Button;
98 QComboBox *m_ComboBox;
131 QWidget *
createEditor(QWidget *parent,
const QStyleOptionViewItem &option,
const QModelIndex &index)
const override;
139 void paint(QPainter *painter,
const QStyleOptionViewItem &option,
const QModelIndex &index)
const override;
146 void setEditorData(QWidget *editor,
const QModelIndex &index)
const override;
154 void setModelData(QWidget *editor, QAbstractItemModel *model,
const QModelIndex &index)
const override;
163 void OnComboBoxCurrentIndexChanged(
int index);
164 void OnSpinBoxEditingFinished();
165 void OnColorPicked();
168 std::string GetPropertyName(
const QModelIndex &index)
const;
Custom QListView used as the popup view for combo boxes in property editing.
QmitkComboBoxListView(QComboBox *comboBox=nullptr)
Constructs the list view for the given combo box.
void paintEvent(QPaintEvent *event) override
void initViewItemOption(QStyleOptionViewItem *option) const override
void resizeEvent(QResizeEvent *event) override
~QmitkComboBoxListView() override
Item delegate for editing MITK properties in a QTreeView or QTableView.
void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override
Paints the item, with special handling for color properties.
QWidget * createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const override
Creates a type-appropriate editor widget for the given model index.
void setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const override
Writes the editor widget data back to the model.
void SetPropertyList(mitk::PropertyList *propertyList)
Sets the property list whose properties are being edited.
QmitkPropertyItemDelegate(QObject *parent=nullptr)
Constructs the delegate.
~QmitkPropertyItemDelegate() override
void setEditorData(QWidget *editor, const QModelIndex &index) const override
Sets the editor widget data from the model.
Key-value list holding instances of BaseProperty.