Fixed issue #939. Calling Formula Wizard through property explorer doesn't

refresh formula.
(grafted from f709c6b0f99abc0c6370bbb37c69eaccbe47a81a)

--HG--
branch : develop
This commit is contained in:
Roman Telezhynskyi 2019-02-07 19:22:39 +02:00
parent 66d2aeb026
commit f6c05ca11e
2 changed files with 5 additions and 5 deletions

View File

@ -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.

View File

@ -85,8 +85,8 @@ void VFormulaPropertyEditor::SetFormula(const VFormula& formula)
//---------------------------------------------------------------------------------------------------------------------
void VFormulaPropertyEditor::onToolButtonClicked()
{
DialogEditWrongFormula* tmpWidget = new DialogEditWrongFormula(formula.getData(), formula.getToolId(),
qApp->getMainWindow());
QScopedPointer<DialogEditWrongFormula> 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());
}
}