diff --git a/src/libs/vtools/dialogs/tools/piece/dialogseamallowance.cpp b/src/libs/vtools/dialogs/tools/piece/dialogseamallowance.cpp index 311e6bf66..7e2cd8af0 100644 --- a/src/libs/vtools/dialogs/tools/piece/dialogseamallowance.cpp +++ b/src/libs/vtools/dialogs/tools/piece/dialogseamallowance.cpp @@ -917,19 +917,6 @@ void DialogSeamAllowance::ListChanged() SetMoveControls(); } -//--------------------------------------------------------------------------------------------------------------------- -void DialogSeamAllowance::EnableSeamAllowance(bool enable) -{ - uiTabPaths->checkBoxBuiltIn->setEnabled(enable); - uiTabPaths->groupBoxAutomatic->setEnabled(enable); - uiTabPaths->groupBoxCustom->setEnabled(enable); - - if (enable) - { - InitNodesList(); - } -} - //--------------------------------------------------------------------------------------------------------------------- void DialogSeamAllowance::NodeChanged(int index) { @@ -2775,7 +2762,31 @@ void DialogSeamAllowance::InitSeamAllowanceTab() m_timerWidthAfter->setSingleShot(true); connect(m_timerWidthAfter, &QTimer::timeout, this, &DialogSeamAllowance::EvalWidthAfter); - connect(uiTabPaths->checkBoxSeams, &QCheckBox::toggled, this, &DialogSeamAllowance::EnableSeamAllowance); + connect(uiTabPaths->checkBoxSeams, &QCheckBox::toggled, this, [this](bool enable) + { + uiTabPaths->checkBoxBuiltIn->setEnabled(enable); + + if (not enable) + { + uiTabPaths->groupBoxAutomatic->setEnabled(enable); + uiTabPaths->groupBoxCustom->setEnabled(enable); + } + else + { + uiTabPaths->checkBoxBuiltIn->toggled(uiTabPaths->checkBoxBuiltIn->isChecked()); + } + }); + + connect(uiTabPaths->checkBoxBuiltIn, &QCheckBox::toggled, this, [this](bool enable) + { + uiTabPaths->groupBoxAutomatic->setEnabled(not enable); + uiTabPaths->groupBoxCustom->setEnabled(not enable); + + if (not enable) + { + InitNodesList(); + } + }); // init the default seam allowance, convert the value if app unit is different than pattern unit m_saWidth = UnitConvertor(qApp->Settings()->GetDefaultSeamAllowance(), diff --git a/src/libs/vtools/dialogs/tools/piece/dialogseamallowance.h b/src/libs/vtools/dialogs/tools/piece/dialogseamallowance.h index b110ef3bb..d569151e8 100644 --- a/src/libs/vtools/dialogs/tools/piece/dialogseamallowance.h +++ b/src/libs/vtools/dialogs/tools/piece/dialogseamallowance.h @@ -92,7 +92,6 @@ private slots: void ShowPlaceLabelsContextMenu(const QPoint &pos); void ListChanged(); - void EnableSeamAllowance(bool enable); void NodeChanged(int index); void PassmarkChanged(int index); void CSAStartPointChanged(int index);