15 #ifndef BORNAGAIN_GUI_VIEW_FIT_FITPARAMETERDELEGATE_H
16 #define BORNAGAIN_GUI_VIEW_FIT_FITPARAMETERDELEGATE_H
18 #include <QStyledItemDelegate>
29 void paint(QPainter* painter,
const QStyleOptionViewItem& option,
30 const QModelIndex& index)
const override;
32 QWidget*
createEditor(QWidget* parent,
const QStyleOptionViewItem& option,
33 const QModelIndex& index)
const override;
35 void setModelData(QWidget* editor, QAbstractItemModel* model,
36 const QModelIndex& index)
const override;
38 void setEditorData(QWidget* editor,
const QModelIndex& index)
const override;
40 QSize
sizeHint(
const QStyleOptionViewItem& option,
const QModelIndex& index)
const override;
43 const QModelIndex& index)
const override;
53 const QModelIndex& index,
const QString& text)
const;
The FitParameterDelegate class presents the content of SessionModel items in standard QTreeView....
void setEditorData(QWidget *editor, const QModelIndex &index) const override
Propagates the data change from the model to the editor (if it is still opened).
void paintCustomLabel(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index, const QString &text) const
Paints custom text in a a place corresponding given index.
void updateEditorGeometry(QWidget *editor, const QStyleOptionViewItem &option, const QModelIndex &index) const override
Makes an editor occupying whole available space in a cell. If cell contains an icon as a decoration (...
QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const override
Increases height of the row by 20% wrt the default.
QWidget * createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const override
FitParameterDelegate(QObject *parent)
void onCustomEditorDataChanged(const QVariant &)
Notifies everyone that the editor has completed editing the data.
virtual QWidget * createEditorFromIndex(const QModelIndex &index, QWidget *parent) const
void setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const override
Propagates changed data from the editor to the model.
void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override