15 #ifndef BORNAGAIN_GUI_COREGUI_MODELS_SESSIONMODELDELEGATE_H
16 #define BORNAGAIN_GUI_COREGUI_MODELS_SESSIONMODELDELEGATE_H
18 #include <QStyledItemDelegate>
29 void paint(QPainter* painter,
const QStyleOptionViewItem& option,
30 const QModelIndex& index)
const;
32 QWidget*
createEditor(QWidget* parent,
const QStyleOptionViewItem& option,
33 const QModelIndex& index)
const;
35 void setModelData(QWidget* editor, QAbstractItemModel* model,
const QModelIndex& index)
const;
37 void setEditorData(QWidget* editor,
const QModelIndex& index)
const;
39 QSize
sizeHint(
const QStyleOptionViewItem& option,
const QModelIndex& index)
const;
42 const QModelIndex& index)
const;
49 const QModelIndex& index,
const QString& text)
const;
The SessionModelDelegate class presents the content of SessionModel items in standard QTreeView.
QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const
Increases height of the row by 20% wrt the default.
SessionModelDelegate(QObject *parent)
QWidget * createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const
void setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const
Propagates changed data from the editor to the model.
void updateEditorGeometry(QWidget *editor, const QStyleOptionViewItem &option, const QModelIndex &index) const
Makes an editor occupying whole available space in a cell.
void onCustomEditorDataChanged(const QVariant &)
Notifies everyone that the editor has completed editing the data.
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 setEditorData(QWidget *editor, const QModelIndex &index) const
Propagates the data change from the model to the editor (if it is still opened).
void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const