15 #ifndef BORNAGAIN_GUI_VIEW_FIT_PARAMETERTUNINGDELEGATE_H
16 #define BORNAGAIN_GUI_VIEW_FIT_PARAMETERTUNINGDELEGATE_H
18 #include "Fit/Param/RealLimits.h"
19 #include <QItemDelegate>
51 QSize
sizeHint(
const QStyleOptionViewItem& option,
52 const QModelIndex& )
const override
54 return QSize(option.rect.width(), 25);
57 void paint(QPainter* painter,
const QStyleOptionViewItem& option,
58 const QModelIndex& index)
const override;
59 QWidget*
createEditor(QWidget* parent,
const QStyleOptionViewItem& option,
60 const QModelIndex& index)
const override;
61 void setEditorData(QWidget* editor,
const QModelIndex& index)
const override;
62 void setModelData(QWidget* editor, QAbstractItemModel* model,
63 const QModelIndex& index)
const override;
The ParameterItem class represent a tuning value in a parameter tuning tree.
int value_to_slider(double value)
void setItemLimits(const RealLimits &item_limits)
void setRangeFactor(double range_factor)
double slider_to_value(int slider) const
void setReadOnly(bool isReadOnly)
void setValueColumn(int valueColumn)
QHBoxLayout * m_contentLayout
void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override
QWidget * createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const override
~ParameterTuningDelegate() override
QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &) const override
ParameterItem * m_currentItem
QWidget * m_contentWidget
void setSliderRangeFactor(double value)
void updateSlider(double value) const
ScientificSpinBox * m_valueBox
void editorValueChanged(double value)
void emitSignals(double value)
void sliderValueChanged(int position)
ParameterTuningDelegate(QObject *parent=nullptr)
void setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const override
void currentLinkChanged(ParameterItem *item)
void setEditorData(QWidget *editor, const QModelIndex &index) const override
Base class for a GUI data item.