Definition at line 28 of file ParameterTuningDelegate.h.
◆ ParameterTuningDelegate()
ParameterTuningDelegate::ParameterTuningDelegate |
( |
QObject * |
parent = nullptr | ) |
|
Definition at line 89 of file ParameterTuningDelegate.cpp.
90 : QItemDelegate(parent)
QHBoxLayout * m_contentLayout
ParameterItem * m_currentItem
QWidget * m_contentWidget
ScientificSpinBox * m_valueBox
◆ ~ParameterTuningDelegate()
ParameterTuningDelegate::~ParameterTuningDelegate |
( |
| ) |
|
|
overridedefault |
◆ createEditor()
QWidget * ParameterTuningDelegate::createEditor |
( |
QWidget * |
parent, |
|
|
const QStyleOptionViewItem & |
option, |
|
|
const QModelIndex & |
index |
|
) |
| const |
|
override |
Definition at line 126 of file ParameterTuningDelegate.cpp.
133 return QItemDelegate::createEditor(parent, option, index);
135 if (!index.parent().isValid())
138 QVariant data = index.model()->data(index, Qt::EditRole);
146 double value = data.toDouble();
158 if (limits.hasLowerLimit())
163 if (limits.hasUpperLimit())
173 m_slider =
new QSlider(Qt::Horizontal);
174 m_slider->setFocusPolicy(Qt::StrongFocus);
175 m_slider->setTickPosition(QSlider::NoTicks);
int decimalsOfLink() const
RealLimits limitsOfLink() const
int value_to_slider(double value)
void setItemLimits(const RealLimits &item_limits)
void updateSlider(double value) const
void editorValueChanged(double value)
static ParameterItem * toParameterItem(const QModelIndex &index)
void setMaximum(double max)
void setMinimum(double min)
void setValue(double val)
void setSingleStep(double step)
void valueChanged(double value)
References ParameterItem::decimalsOfLink(), editorValueChanged(), ParameterItem::limitsOfLink(), m_contentLayout, m_contentWidget, m_currentItem, m_isReadOnly, m_slider, ParameterTuningDelegate::TuningData::m_smax, ParameterTuningDelegate::TuningData::m_smin, m_tuning_info, m_valueBox, m_valueColumn, ScientificSpinBox::setDecimals(), ParameterTuningDelegate::TuningData::setItemLimits(), ScientificSpinBox::setMaximum(), ScientificSpinBox::setMinimum(), ScientificSpinBox::setSingleStep(), ScientificSpinBox::setValue(), ParameterTuningDelegate::TuningData::step(), ParameterTuningModel::toParameterItem(), updateSlider(), ParameterTuningDelegate::TuningData::value_to_slider(), and ScientificSpinBox::valueChanged().
◆ currentLinkChanged
void ParameterTuningDelegate::currentLinkChanged |
( |
ParameterItem * |
item | ) |
|
|
signal |
◆ editorValueChanged
void ParameterTuningDelegate::editorValueChanged |
( |
double |
value | ) |
|
|
privateslot |
◆ emitSignals()
void ParameterTuningDelegate::emitSignals |
( |
double |
value | ) |
|
|
private |
◆ paint()
void ParameterTuningDelegate::paint |
( |
QPainter * |
painter, |
|
|
const QStyleOptionViewItem & |
option, |
|
|
const QModelIndex & |
index |
|
) |
| const |
|
override |
Definition at line 103 of file ParameterTuningDelegate.cpp.
107 if (!index.parent().isValid())
110 QVariant valueAsVariant = index.model()->data(index, Qt::EditRole);
111 if (valueAsVariant.isValid() && valueAsVariant.type() == QVariant::Double) {
112 double value = valueAsVariant.toDouble();
115 QStyleOptionViewItem myOption = option;
116 myOption.displayAlignment = Qt::AlignLeft | Qt::AlignVCenter;
118 drawDisplay(painter, myOption, myOption.rect, text);
119 drawFocus(painter, myOption, myOption.rect);
123 QItemDelegate::paint(painter, option, index);
static QString toString(double val, int decimal_points)
References m_valueColumn, and ScientificSpinBox::toString().
◆ setEditorData()
void ParameterTuningDelegate::setEditorData |
( |
QWidget * |
editor, |
|
|
const QModelIndex & |
index |
|
) |
| const |
|
override |
◆ setModelData()
void ParameterTuningDelegate::setModelData |
( |
QWidget * |
editor, |
|
|
QAbstractItemModel * |
model, |
|
|
const QModelIndex & |
index |
|
) |
| const |
|
override |
◆ setReadOnly()
void ParameterTuningDelegate::setReadOnly |
( |
bool |
isReadOnly | ) |
|
◆ setSliderRangeFactor()
void ParameterTuningDelegate::setSliderRangeFactor |
( |
double |
value | ) |
|
◆ setValueColumn()
void ParameterTuningDelegate::setValueColumn |
( |
int |
valueColumn | ) |
|
|
inline |
◆ sizeHint()
QSize ParameterTuningDelegate::sizeHint |
( |
const QStyleOptionViewItem & |
option, |
|
|
const QModelIndex & |
|
|
) |
| const |
|
inlineoverride |
◆ sliderValueChanged
void ParameterTuningDelegate::sliderValueChanged |
( |
int |
position | ) |
|
|
privateslot |
◆ updateSlider()
void ParameterTuningDelegate::updateSlider |
( |
double |
value | ) |
const |
|
private |
◆ m_contentLayout
QHBoxLayout* ParameterTuningDelegate::m_contentLayout |
|
mutableprivate |
◆ m_contentWidget
QWidget* ParameterTuningDelegate::m_contentWidget |
|
mutableprivate |
◆ m_currentItem
◆ m_isReadOnly
bool ParameterTuningDelegate::m_isReadOnly |
|
private |
◆ m_slider
QSlider* ParameterTuningDelegate::m_slider |
|
mutableprivate |
◆ m_tuning_info
◆ m_valueBox
◆ m_valueColumn
int ParameterTuningDelegate::m_valueColumn |
|
private |
The documentation for this class was generated from the following files: