Show in tooltip parser error message.

--HG--
branch : feature
This commit is contained in:
dismine 2014-09-06 11:38:30 +03:00
parent 6c784fcdca
commit f6d3068d0f
2 changed files with 5 additions and 1 deletions

View File

@ -323,7 +323,7 @@
</size> </size>
</property> </property>
<property name="toolTip"> <property name="toolTip">
<string>Value of length</string> <string>Value of angle</string>
</property> </property>
<property name="text"> <property name="text">
<string>_</string> <string>_</string>

View File

@ -429,6 +429,7 @@ void DialogTool::Eval(const QString &text, bool &flag, QTimer *timer, QLabel *la
flag = false; flag = false;
ChangeColor(labelEditFormula, Qt::red); ChangeColor(labelEditFormula, Qt::red);
label->setText(tr("Error")); label->setText(tr("Error"));
label->setToolTip(tr("Empty field"));
} }
else else
{ {
@ -448,6 +449,7 @@ void DialogTool::Eval(const QString &text, bool &flag, QTimer *timer, QLabel *la
flag = false; flag = false;
ChangeColor(labelEditFormula, Qt::red); ChangeColor(labelEditFormula, Qt::red);
label->setText(tr("Error")); label->setText(tr("Error"));
label->setToolTip(tr("Value can't be 0"));
} }
else else
{ {
@ -463,6 +465,7 @@ void DialogTool::Eval(const QString &text, bool &flag, QTimer *timer, QLabel *la
label->setText(loc.toString(result) + postfix); label->setText(loc.toString(result) + postfix);
flag = true; flag = true;
ChangeColor(labelEditFormula, okColor); ChangeColor(labelEditFormula, okColor);
label->setToolTip(tr("Value"));
emit ToolTip(""); emit ToolTip("");
} }
} }
@ -472,6 +475,7 @@ void DialogTool::Eval(const QString &text, bool &flag, QTimer *timer, QLabel *la
flag = false; flag = false;
ChangeColor(labelEditFormula, Qt::red); ChangeColor(labelEditFormula, Qt::red);
emit ToolTip("Parser error: "+e.GetMsg()); emit ToolTip("Parser error: "+e.GetMsg());
label->setToolTip("Parser error: "+e.GetMsg());
qDebug() << "\nMath parser error:\n" qDebug() << "\nMath parser error:\n"
<< "--------------------------------------\n" << "--------------------------------------\n"
<< "Message: " << e.GetMsg() << "\n" << "Message: " << e.GetMsg() << "\n"