Skip to content
Snippets Groups Projects
Commit 6a87e027 authored by Wuttke, Joachim's avatar Wuttke, Joachim
Browse files

rewire property -> spinbox

parent ee843dce
No related branches found
No related tags found
1 merge request!2268repair coupling between mask overlay and spinbox (#883)
......@@ -48,7 +48,7 @@ DoubleSpinBox::DoubleSpinBox(DoubleProperty* d)
{
replaceProperty(d);
QObject::connect(this, &QAbstractSpinBox::editingFinished, [this] {
connect(this, &QAbstractSpinBox::editingFinished, [this] {
ASSERT(m_property);
setValue(fromDisplay());
m_old_dir = 0;
......@@ -59,12 +59,15 @@ DoubleSpinBox::DoubleSpinBox(DoubleProperty* d)
void DoubleSpinBox::replaceProperty(DoubleProperty* d)
{
disconnect(m_property);
m_property = d;
if (m_property) {
setFocusPolicy(Qt::StrongFocus);
setToolTip(d->tooltip());
setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed);
lineEdit()->setText(toString(m_property->value()));
connect(d, &DoubleProperty::setAndNotifyCalled, this, &DoubleSpinBox::updateValue);
// [this] { updateValue(); });
}
setReadOnly(!m_property);
updateValue();
......
......@@ -35,8 +35,8 @@ void addSpinBox(MaskItem* mask, QFormLayout* layout, DoubleProperty& property)
ASSERT(mask);
emit mask->maskGeometryChanged();
});
QObject::connect(&property, &DoubleProperty::setAndNotifyCalled, mask,
&OverlayItem::maskGeometryChanged);
QObject::connect(&property, &DoubleProperty::setAndNotifyCalled, spinbox,
&DoubleSpinBox::updateValue);
}
} // namespace
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment