If formula equal zero it is also error.
--HG-- branch : develop
This commit is contained in:
parent
41834c7b36
commit
717a94879c
|
@ -454,19 +454,28 @@ void DialogTool::Eval(const QString &text, bool &flag, QTimer *timer, QLabel *la
|
||||||
const qreal result = cal->EvalFormula(formula);
|
const qreal result = cal->EvalFormula(formula);
|
||||||
delete cal;
|
delete cal;
|
||||||
|
|
||||||
if (qApp->getSettings()->value("configuration/osSeparator", 1).toBool())
|
//if result equal 0
|
||||||
|
if (qFuzzyCompare(1 + result, 1 + 0))
|
||||||
{
|
{
|
||||||
QLocale loc = QLocale::system();
|
flag = false;
|
||||||
label->setText(loc.toString(result) + VDomDocument::UnitsToStr(qApp->patternUnit(), true));
|
ChangeColor(labelEditFormula, Qt::red);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
QLocale loc = QLocale(QLocale::C);
|
if (qApp->getSettings()->value("configuration/osSeparator", 1).toBool())
|
||||||
label->setText(loc.toString(result) + VDomDocument::UnitsToStr(qApp->patternUnit(), true));
|
{
|
||||||
|
QLocale loc = QLocale::system();
|
||||||
|
label->setText(loc.toString(result) + VDomDocument::UnitsToStr(qApp->patternUnit(), true));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
QLocale loc = QLocale(QLocale::C);
|
||||||
|
label->setText(loc.toString(result) + VDomDocument::UnitsToStr(qApp->patternUnit(), true));
|
||||||
|
}
|
||||||
|
flag = true;
|
||||||
|
ChangeColor(labelEditFormula, okColor);
|
||||||
|
emit ToolTip("");
|
||||||
}
|
}
|
||||||
flag = true;
|
|
||||||
ChangeColor(labelEditFormula, okColor);
|
|
||||||
emit ToolTip("");
|
|
||||||
}
|
}
|
||||||
catch (qmu::QmuParserError &e)
|
catch (qmu::QmuParserError &e)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue
Block a user