PDA

View Full Version : QwtTextLabel to render some MathML code



agarny
6th October 2011, 07:34
Hi, I am trying to render some MathML code using QwtTextLabel, but though different parts of my equation get rendered where I would expect, the end result is still ugly and, in fact, useless.

I am pretty certain that I am missing something, but since there doesn't seem to be any Qwt example on how to do that, I am not sure what I am missing.

Basically, I did what is mentioned in the documentation, i.e.


#include <qwt_mathml_text_engine.h>

QwtText::setTextEngine(QwtText::MathMLText, new QwtMathMLTextEngine());From there, I just used QwtTextLabel as 'normal'. Anyway, attached are what I get using QwtTextLabel with QwtMathMLTextEngine as the text engine (6939), and then what I get using QtMmlWidget (6938).

Anyway, I am trying to move from QtMmlWidget to Qwt, since the former is not maintained anymore. So, any help would be most appreciated.

Note #1: even QtMmlWidget doesn't do a superb job of rendering MathML code, but at least I am able to get something...
Note #2: even with the 'bad' rendering, I noticed that QwtTextLabel was rather slow (compared to QtMmlWidget), but maybe it's because I haven't got things to work the way they should...?

Uwe
6th October 2011, 09:39
Anyway, I am trying to move from QtMmlWidget to Qwt, since the former is not maintained anymore.

Note, that both use the same MathML renderer - so comparing them is somehow pointless,

Uwe

agarny
6th October 2011, 21:24
Hi Uwe,

Yes, I know about Qwt using QtMmlWidget's MathML renderer. Also, I have never said I was trying to compare the two of them. All I said, from what you quoted, is that QtMmlWidget is not maintained anymore while Qwt is (thanks to you). In other words, should an issue ever be found with the MathML renderer, or an improvement suggested, then it will have a good chance of being addressed in Qwt while next to no chance of being addressed in QtMmlWidget. That's all I am interested in and what I would like to achieve by switching to Qwt.

Alan

agarny
22nd August 2013, 12:57
For whoever interested in using MathML with Qwt: http://www.qtcentre.org/threads/54293-MathML-problem-displaying-a-math-expression?p=249735#post249735.