How to show math equations in QTextEdit?

♀尐吖头ヾ 提交于 2019-12-06 01:12:43

问题


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.


回答1:


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!