Created very simple MathML formula with this editor, inserted it into my code:
logitLabel->setPlainText(logitFormula(1, 2, 3, 4));
QString SetupPanel
::logitFormula(double arg1,
double arg2,
double arg3,
double arg4
) const {
"<math><mn>%1</mn><mo>+</mo><mfrac><mn>%2</mn><mrow><mn>1</mn><mo>+</mo>"
"<msup><mi>e</mi><mrow><mn>%3</mn><mo>·</mo><mi>X</mi><mo>+</mo>"
"<mn>%4</mn></mrow></msup></mrow></mfrac></math>")
return formula;
}
logitLabel->setPlainText(logitFormula(1, 2, 3, 4));
QString SetupPanel::logitFormula(double arg1, double arg2, double arg3, double arg4) const
{
QString formula = QString(
"<math><mn>%1</mn><mo>+</mo><mfrac><mn>%2</mn><mrow><mn>1</mn><mo>+</mo>"
"<msup><mi>e</mi><mrow><mn>%3</mn><mo>·</mo><mi>X</mi><mo>+</mo>"
"<mn>%4</mn></mrow></msup></mrow></mfrac></math>")
.arg(QString::number(arg1))
.arg(QString::number(arg2))
.arg(QString::number(arg3))
.arg(QString::number(arg4));
return formula;
}
To copy to clipboard, switch view to plain text mode
However formula looks strange in application:
bad_formula.png
That is how it looks in editor:
good_formula.png
What is wrong here: MathML implementation in Qwt, formula editor, need to simplify formula or what? Is MathML ready for production here or need to search for other possibilities to render formulas?
Bookmarks