如何在QTextEdit中显示数学方程式? [英] How to show math equations in QTextEdit?

查看:179
本文介绍了如何在QTextEdit中显示数学方程式?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人知道如何仅使用Python在QTextEdit中显示以任何格式(TXT,MathML,MML,LaTeX,HTML,XML或其他任何形式)编写的数学方程式吗?我试图从Qt中找到MathML窗口小部件,但是它从他们的网站上消失了,我在任何地方都找不到它.

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.

我不为方程式源(字符串或文件)而烦恼.我只是想不出如何很好地显示它们(与它们在网页上的显示方式相同,例如 http://en.wikipedia.org/wiki/MathML ).

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).

我的QTextEdit当前获得一个HTML字符串.我尝试从该Wikipedia文章中嵌入MathML示例,但无法正确显示,它会忽略所有这些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.

推荐答案

您可以使用以下代码: http://qwt. sourceforge.net/

You can use this: http://qwt.sourceforge.net/

我在Qt中找不到MathML小部件,这真是很有趣.

It definitely seems funny that I cannot find the MathML widget in Qt.

我认为他们正在尝试将其替换为Webkit支持,但尚未实现:

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

这篇关于如何在QTextEdit中显示数学方程式?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆