diff --git a/ChangeLog.txt b/ChangeLog.txt index 671119a0c..7d697dbd7 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -24,6 +24,7 @@ - [#930] Valentina doesn't update translation for variables after dynamic language switch. - [#931] Variable translation for Greek and Chinese are broken. - [#938] Dialog Seam Allowance doesn't block user from saving broken formula. +- [#939] Calling Formula Wizard through property explorer doesn't refresh formula. # Version 0.6.1 October 23, 2018 - [#885] Regression. Broken support for multi size measurements. diff --git a/src/app/valentina/core/vformulapropertyeditor.cpp b/src/app/valentina/core/vformulapropertyeditor.cpp index 06b2dca77..62a4bf470 100644 --- a/src/app/valentina/core/vformulapropertyeditor.cpp +++ b/src/app/valentina/core/vformulapropertyeditor.cpp @@ -85,8 +85,8 @@ void VFormulaPropertyEditor::SetFormula(const VFormula& formula) //--------------------------------------------------------------------------------------------------------------------- void VFormulaPropertyEditor::onToolButtonClicked() { - DialogEditWrongFormula* tmpWidget = new DialogEditWrongFormula(formula.getData(), formula.getToolId(), - qApp->getMainWindow()); + QScopedPointer tmpWidget(new DialogEditWrongFormula(formula.getData(), formula.getToolId(), + qApp->getMainWindow())); tmpWidget->setCheckZero(formula.getCheckZero()); tmpWidget->setPostfix(formula.getPostfix()); tmpWidget->SetFormula(formula.GetFormula(FormulaType::FromUser)); @@ -94,11 +94,10 @@ void VFormulaPropertyEditor::onToolButtonClicked() if (tmpWidget->exec() == QDialog::Accepted) { formula.SetFormula(tmpWidget->GetFormula(), FormulaType::ToUser); + formula.Eval(); TextLabel->setText(formula.getStringValue()); - delete tmpWidget; emit dataChangedByUser(formula, this); - VPE::UserChangeEvent *event = new VPE::UserChangeEvent(); - QCoreApplication::postEvent ( this, event ); + QCoreApplication::postEvent(this, new VPE::UserChangeEvent()); } }