I decided to give the MML widget a try to create an example for MathML rendering: display a mathematical formula from the description contained in an XML file. This is a component available from Qt solutions (see my previous post about them) to enhance the by itself long list of classes and modules already available in Qt. For more information about the MathML standard, you may read this MathML introduction
The component is composed of just one class, QtMmlWidget which can be used as source code into our project, or it can be built into a library (./configure -library). One requirement is the presence of a Unicode font, which can be found here font for Mozilla.
My example is inspired by the sample contained along MML widget from Qt. In this case, the text editor has syntax highlighting (courtesy of the Qt's example about xmlpatterns) and the the formula is updated every time the Save option is used. Besides that, the formula can be exported as an image file.
I hope that this simple application may serve as an introduction to both MathML and the MML capabilities that Qt provide us.
Subscribe to:
Post Comments (Atom)
Good ! Do you know whether, there will be any available python bindings for it ?
ReplyDeleteI'm not sure that this component is available for Python too. Would you like to try contacting some of the forums (http://qt.nokia.com/developer/community-resources)?
ReplyDeleteAnother approach could be trying to build the component as a shared library (.so in Linux or .dll in Windows) and using it from Python as an external library.
Good luck!
Is that an april fool?
ReplyDeleteBecause I can't find it anymore :)
This component looks like it has disappeared off the face of the Internet...
ReplyDeleteWell, I don'tr know how to say. It's a really surprise to me that Nokia removed all the components from the Qt page (catalog) and move it into gitorious but I cannot find it even there.
ReplyDeleteOne thing I can suggest is to give Qt Webkit a try to see if the MathML support for HTML5 is working now.
I've found some source for the component hosted elsewhere:
ReplyDeletehttp://kdeedu.sourcearchive.com/documentation/4.4.1/dir_db7223a53d9a4a5aeccf7dd8eac40251.html
I was able to build it just fine!
For whoever is looking for QtMmlWidget: ftp://ftp.qt.nokia.com/qt/solutions/lgpl/.
ReplyDeleteQtMmlWidget has long been discontinued. QtMmlWidget's MathML renderer was incorporated in Qwt at some point, but it wasn't working properly. I have however 'fixed' it and it is now working in a way similar to the original QtMmlWidget (see http://www.qtcentre.org/threads/54293-MathML-problem-displaying-a-math-expression?p=249735#post249735). Hopefully, 'my' changes will get incorporated in Qwt.
Delete