If formula equal zero it is also error.
--HG-- branch : develop
This commit is contained in:
parent
41834c7b36
commit
717a94879c
|
@ -454,6 +454,14 @@ 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 result equal 0
|
||||||
|
if (qFuzzyCompare(1 + result, 1 + 0))
|
||||||
|
{
|
||||||
|
flag = false;
|
||||||
|
ChangeColor(labelEditFormula, Qt::red);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
if (qApp->getSettings()->value("configuration/osSeparator", 1).toBool())
|
if (qApp->getSettings()->value("configuration/osSeparator", 1).toBool())
|
||||||
{
|
{
|
||||||
QLocale loc = QLocale::system();
|
QLocale loc = QLocale::system();
|
||||||
|
@ -468,6 +476,7 @@ void DialogTool::Eval(const QString &text, bool &flag, QTimer *timer, QLabel *la
|
||||||
ChangeColor(labelEditFormula, okColor);
|
ChangeColor(labelEditFormula, okColor);
|
||||||
emit ToolTip("");
|
emit ToolTip("");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
catch (qmu::QmuParserError &e)
|
catch (qmu::QmuParserError &e)
|
||||||
{
|
{
|
||||||
label->setText(tr("Error"));
|
label->setText(tr("Error"));
|
||||||
|
|
Loading…
Reference in New Issue
Block a user