Does anyone know how to show mathematical equations in QTextEdit written in any format (TXT, MathML, MML, LaTeX, HTML, XML or anything) using only Python, that is without using 3rd party packages like Latex itself.? I tried to find the MathML Widget from Qt but it disappeared from their web site and I couldn't find it anywhere.
I'm not fussed about the equation source (either a string or a file). I just can't figure out how to show them nicely (the same way as they appear on a web page, e.g. http://en.wikipedia.org/wiki/MathML).
My QTextEdit currently gets an HTML string. I tried embedding the MathML example from that Wikipedia article, but it doesn't show it properly, it ignores all those MathML tags.
Will really appreciate your help. Thank you.
You can use this: http://qwt.sourceforge.net/
It definitely seems funny that I cannot find the MathML widget in Qt.
EDIT: I think they are trying to replace it with webkit support, but it isn't implemented yet: http://developer.qt.nokia.com/wiki/Qt_Webkit_HTML5_Score
来源:https://stackoverflow.com/questions/5385740/how-to-show-math-equations-in-qtextedit