Home |
The QtMmlWidget class renders mathematical formulas written in MathML 2.0. More...
#include <QtMmlWidget>
Inherits QFrame.
The QtMmlWidget class renders mathematical formulas written in MathML 2.0.
QtMmlWidget implements the Presentation Markup subset of the MathML 2.0 specification, with a few exceptions.
QtMmlWidget *mmlWidget = new QtMmlWidget(this); QString errorMsg; int errorLine; int errorColumn; bool ok = mmlWidget->setContent(mmlText, &errorMsg, &errorLine, &errorColumn); if (!ok) { qWarning("MathML error: %s, Line: %d, Column: %d", errorMsg.latin1(), errorLine, errorColumn); }
This ennumerated type is used in fontName() and setFontName() to specify a font type.
Constant | Value | Description |
---|---|---|
QtMmlWidget::NormalFont | 0 | The default font type, used to render expressions for which no mathvariant or fontfamily is specified, or for which the "normal" mathvariant is specified. |
QtMmlWidget::FrakturFont | 1 | The font type used to render expressions for which the "fraktur" mathvariant is specified. |
QtMmlWidget::SansSerifFont | 2 | The font type used to render expressions for which the "sans-serif" mathvariant is specified. |
QtMmlWidget::ScriptFont | 3 | The font type used to render expressions for which the "script" mathvariant is specified. |
QtMmlWidget::MonospaceFont | 4 | The font type used to render expressions for which the "monospace" mathvariant is specified. |
QtMmlWidget::DoublestruckFont | 5 | The font type used to render expressions for which the "doublestruck" mathvariant is specified. |
See also setFontName(), fontName(), setBaseFontPointSize(), and baseFontPointSize().
Constructs a QtMmlWidget object. The parent parameter is passed to QFrame's constructor.
Destructs a QtMmlWidget object.
Returns the point size of the font used to render expressions whose scriptlevel is 0.
See also setBaseFontPointSize(), fontName(), and setFontName().
Clears the contents of this widget.
Returns true if each expression should be drawn with a red bounding rectangle; otherwise returns false. This is mostly useful for debugging MathML expressions.
See also setDrawFrames().
Returns the name of the font used to render the font type.
See also setFontName(), setBaseFontPointSize(), baseFontPointSize(), and QtMmlWidget::MmlFont.
Sets the point size of the font used to render expressions whose scriptlevel is 0.
See also baseFontPointSize(), fontName(), and setFontName().
Sets the MathML expression to be rendered. The expression is given in the string text. If the expression is successfully parsed, this method returns true; otherwise it returns false. If an error occured errorMsg is set to a diagnostic message, while errorLine and errorColumn contain the location of the error. Any of errorMsg, errorLine and errorColumn may be 0, in which case they are not set.
text should contain MathML 2.0 presentation markup elements enclosed in a <math> element.
If b is true, draws a red bounding rectangle around each expression; if b is false, no such rectangle is drawn. This is mostly useful for debugging MathML expressions.
See also drawFrames().
Sets the name of the font used to render the font type to name.
See also fontName(), setBaseFontPointSize(), baseFontPointSize(), and QtMmlWidget::MmlFont.
Returns the size of the formula in pixels.
Reimplemented from QWidget.
Copyright © 2009 Nokia Corporation and/or its subsidiary(-ies) | Trademarks | Qt Solutions |