<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <title>Qwt User's Guide: QwtTextEngine Class Reference</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <link href="doxygen.css" rel="stylesheet" type="text/css"/> </head> <body> <!-- Generated by Doxygen 1.7.3 --> <div id="top"> <div id="titlearea"> <table cellspacing="0" cellpadding="0"> <tbody> <tr style="height: 56px;"> <td style="padding-left: 0.5em;"> <div id="projectname">Qwt User's Guide <span id="projectnumber">6.0.1</span></div> </td> </tr> </tbody> </table> </div> <div id="navrow1" class="tabs"> <ul class="tablist"> <li><a href="index.html"><span>Main Page</span></a></li> <li><a href="pages.html"><span>Related Pages</span></a></li> <li class="current"><a href="annotated.html"><span>Classes</span></a></li> <li><a href="files.html"><span>Files</span></a></li> </ul> </div> <div id="navrow2" class="tabs2"> <ul class="tablist"> <li><a href="annotated.html"><span>Class List</span></a></li> <li><a href="classes.html"><span>Class Index</span></a></li> <li><a href="inherits.html"><span>Class Hierarchy</span></a></li> <li><a href="functions.html"><span>Class Members</span></a></li> </ul> </div> </div> <div class="header"> <div class="summary"> <a href="#pub-methods">Public Member Functions</a> | <a href="#pro-methods">Protected Member Functions</a> </div> <div class="headertitle"> <h1>QwtTextEngine Class Reference</h1> </div> </div> <div class="contents"> <!-- doxytag: class="QwtTextEngine" --> <p>Abstract base class for rendering text strings. <a href="#_details">More...</a></p> <p><code>#include <<a class="el" href="qwt__text__engine_8h_source.html">qwt_text_engine.h</a>></code></p> <div class="dynheader"> Inheritance diagram for QwtTextEngine:</div> <div class="dyncontent"> <div class="center"><img src="class_qwt_text_engine__inherit__graph.png" border="0" usemap="#_qwt_text_engine_inherit__map" alt="Inheritance graph"/></div> <map name="_qwt_text_engine_inherit__map" id="_qwt_text_engine_inherit__map"> <area shape="rect" id="node3" href="class_qwt_math_m_l_text_engine.html" title="Text Engine for the MathML renderer of the Qt solutions package." alt="" coords="5,83,160,112"/><area shape="rect" id="node5" href="class_qwt_plain_text_engine.html" title="A text engine for plain texts." alt="" coords="184,83,323,112"/><area shape="rect" id="node7" href="class_qwt_rich_text_engine.html" title="A text engine for Qt rich texts." alt="" coords="347,83,480,112"/></map> <center><span class="legend">[<a href="graph_legend.html">legend</a>]</span></center></div> <p><a href="class_qwt_text_engine-members.html">List of all members.</a></p> <table class="memberdecls"> <tr><td colspan="2"><h2><a name="pub-methods"></a> Public Member Functions</h2></td></tr> <tr><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><a class="el" href="class_qwt_text_engine.html#ad727f58f9eebfec86369e7f2e5bf6a59">draw</a> (QPainter *painter, const QRectF &rect, int flags, const QString &text) const =0</td></tr> <tr><td class="memItemLeft" align="right" valign="top">virtual double </td><td class="memItemRight" valign="bottom"><a class="el" href="class_qwt_text_engine.html#aee891b14d90c817b8c73d551f623cc17">heightForWidth</a> (const QFont &font, int flags, const QString &text, double width) const =0</td></tr> <tr><td class="memItemLeft" align="right" valign="top">virtual bool </td><td class="memItemRight" valign="bottom"><a class="el" href="class_qwt_text_engine.html#a98316f2f6f4f50216ceffbe9babe2901">mightRender</a> (const QString &text) const =0</td></tr> <tr><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><a class="el" href="class_qwt_text_engine.html#a83c8d3dc590b9914e9216c01e78e0838">textMargins</a> (const QFont &font, const QString &text, double &left, double &right, double &top, double &bottom) const =0</td></tr> <tr><td class="memItemLeft" align="right" valign="top">virtual QSizeF </td><td class="memItemRight" valign="bottom"><a class="el" href="class_qwt_text_engine.html#ad9382cc8ff22c6b3e448fce566a76178">textSize</a> (const QFont &font, int flags, const QString &text) const =0</td></tr> <tr><td class="memItemLeft" align="right" valign="top">virtual </td><td class="memItemRight" valign="bottom"><a class="el" href="class_qwt_text_engine.html#adda9e23494429c54b3cc3452940fb2bc">~QwtTextEngine</a> ()</td></tr> <tr><td colspan="2"><h2><a name="pro-methods"></a> Protected Member Functions</h2></td></tr> <tr><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="class_qwt_text_engine.html#a97c5ef76ee920ab0f19e178e85017d9d">QwtTextEngine</a> ()</td></tr> </table> <hr/><a name="_details"></a><h2>Detailed Description</h2> <div class="textblock"><p>Abstract base class for rendering text strings. </p> <p>A text engine is responsible for rendering texts for a specific text format. They are used by <a class="el" href="class_qwt_text.html" title="A class representing a text.">QwtText</a> to render a text.</p> <p><a class="el" href="class_qwt_plain_text_engine.html" title="A text engine for plain texts.">QwtPlainTextEngine</a> and <a class="el" href="class_qwt_rich_text_engine.html" title="A text engine for Qt rich texts.">QwtRichTextEngine</a> are part of the Qwt library. The implementation of <a class="el" href="class_qwt_math_m_l_text_engine.html" title="Text Engine for the MathML renderer of the Qt solutions package.">QwtMathMLTextEngine</a> uses code from the Qt solution package. Because of license implications it is built into a separate library.</p> <dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="class_qwt_text.html#aef6a1e71b1feba3116ce69f6c9de70ad">QwtText::setTextEngine()</a> </dd></dl> </div><hr/><h2>Constructor & Destructor Documentation</h2> <a class="anchor" id="adda9e23494429c54b3cc3452940fb2bc"></a><!-- doxytag: member="QwtTextEngine::~QwtTextEngine" ref="adda9e23494429c54b3cc3452940fb2bc" args="()" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">QwtTextEngine::~QwtTextEngine </td> <td>(</td> <td class="paramname"></td><td>)</td> <td><code> [virtual]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Destructor. </p> </div> </div> <a class="anchor" id="a97c5ef76ee920ab0f19e178e85017d9d"></a><!-- doxytag: member="QwtTextEngine::QwtTextEngine" ref="a97c5ef76ee920ab0f19e178e85017d9d" args="()" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">QwtTextEngine::QwtTextEngine </td> <td>(</td> <td class="paramname"></td><td>)</td> <td><code> [protected]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Constructor. </p> </div> </div> <hr/><h2>Member Function Documentation</h2> <a class="anchor" id="ad727f58f9eebfec86369e7f2e5bf6a59"></a><!-- doxytag: member="QwtTextEngine::draw" ref="ad727f58f9eebfec86369e7f2e5bf6a59" args="(QPainter *painter, const QRectF &rect, int flags, const QString &text) const =0" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">virtual void QwtTextEngine::draw </td> <td>(</td> <td class="paramtype">QPainter * </td> <td class="paramname"><em>painter</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const QRectF & </td> <td class="paramname"><em>rect</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">int </td> <td class="paramname"><em>flags</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const QString & </td> <td class="paramname"><em>text</em> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td> const<code> [pure virtual]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Draw the text in a clipping rectangle</p> <dl><dt><b>Parameters:</b></dt><dd> <table class="params"> <tr><td class="paramname">painter</td><td>Painter </td></tr> <tr><td class="paramname">rect</td><td>Clipping rectangle </td></tr> <tr><td class="paramname">flags</td><td>Bitwise OR of the flags like in for QPainter::drawText </td></tr> <tr><td class="paramname">text</td><td>Text to be rendered </td></tr> </table> </dd> </dl> <p>Implemented in <a class="el" href="class_qwt_plain_text_engine.html#a5fc2780c10ac2fb41aec91223b60fac7">QwtPlainTextEngine</a>, <a class="el" href="class_qwt_rich_text_engine.html#a8f345540be2a90db3ce5a252ec443ce7">QwtRichTextEngine</a>, and <a class="el" href="class_qwt_math_m_l_text_engine.html#a4a347e3f7ac8fa7f57c4fcf62e4f2b36">QwtMathMLTextEngine</a>.</p> </div> </div> <a class="anchor" id="aee891b14d90c817b8c73d551f623cc17"></a><!-- doxytag: member="QwtTextEngine::heightForWidth" ref="aee891b14d90c817b8c73d551f623cc17" args="(const QFont &font, int flags, const QString &text, double width) const =0" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">virtual double QwtTextEngine::heightForWidth </td> <td>(</td> <td class="paramtype">const QFont & </td> <td class="paramname"><em>font</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">int </td> <td class="paramname"><em>flags</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const QString & </td> <td class="paramname"><em>text</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">double </td> <td class="paramname"><em>width</em> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td> const<code> [pure virtual]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Find the height for a given width</p> <dl><dt><b>Parameters:</b></dt><dd> <table class="params"> <tr><td class="paramname">font</td><td>Font of the text </td></tr> <tr><td class="paramname">flags</td><td>Bitwise OR of the flags used like in QPainter::drawText </td></tr> <tr><td class="paramname">text</td><td>Text to be rendered </td></tr> <tr><td class="paramname">width</td><td>Width</td></tr> </table> </dd> </dl> <dl class="return"><dt><b>Returns:</b></dt><dd>Calculated height </dd></dl> <p>Implemented in <a class="el" href="class_qwt_plain_text_engine.html#a9190bdcb6ed447a5bc056ad8304ad58b">QwtPlainTextEngine</a>, <a class="el" href="class_qwt_rich_text_engine.html#ab19cc5ad4ae33aaffc6aaf5d58b93b19">QwtRichTextEngine</a>, and <a class="el" href="class_qwt_math_m_l_text_engine.html#a3d5b7c9be31d9282b4c86c8ec3f4c8df">QwtMathMLTextEngine</a>.</p> </div> </div> <a class="anchor" id="a98316f2f6f4f50216ceffbe9babe2901"></a><!-- doxytag: member="QwtTextEngine::mightRender" ref="a98316f2f6f4f50216ceffbe9babe2901" args="(const QString &text) const =0" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">virtual bool QwtTextEngine::mightRender </td> <td>(</td> <td class="paramtype">const QString & </td> <td class="paramname"><em>text</em></td><td>)</td> <td> const<code> [pure virtual]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Test if a string can be rendered by this text engine</p> <dl><dt><b>Parameters:</b></dt><dd> <table class="params"> <tr><td class="paramname">text</td><td>Text to be tested </td></tr> </table> </dd> </dl> <dl class="return"><dt><b>Returns:</b></dt><dd>true, if it can be rendered </dd></dl> <p>Implemented in <a class="el" href="class_qwt_plain_text_engine.html#ae7bd7417f0173e2d35fe1bf7a514ec9b">QwtPlainTextEngine</a>, <a class="el" href="class_qwt_rich_text_engine.html#a42da46eee5fbda55e34b18c64b0b5e0b">QwtRichTextEngine</a>, and <a class="el" href="class_qwt_math_m_l_text_engine.html#a59ca5842c32fd12cfd2aeeef5c985600">QwtMathMLTextEngine</a>.</p> </div> </div> <a class="anchor" id="a83c8d3dc590b9914e9216c01e78e0838"></a><!-- doxytag: member="QwtTextEngine::textMargins" ref="a83c8d3dc590b9914e9216c01e78e0838" args="(const QFont &font, const QString &text, double &left, double &right, double &top, double &bottom) const =0" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">virtual void QwtTextEngine::textMargins </td> <td>(</td> <td class="paramtype">const QFont & </td> <td class="paramname"><em>font</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const QString & </td> <td class="paramname"><em>text</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">double & </td> <td class="paramname"><em>left</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">double & </td> <td class="paramname"><em>right</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">double & </td> <td class="paramname"><em>top</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">double & </td> <td class="paramname"><em>bottom</em> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td> const<code> [pure virtual]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Return margins around the texts</p> <p>The textSize might include margins around the text, like QFontMetrics::descent. In situations where texts need to be aligend in detail, knowing these margins might improve the layout calculations.</p> <dl><dt><b>Parameters:</b></dt><dd> <table class="params"> <tr><td class="paramname">font</td><td>Font of the text </td></tr> <tr><td class="paramname">text</td><td>Text to be rendered </td></tr> <tr><td class="paramname">left</td><td>Return value for the left margin </td></tr> <tr><td class="paramname">right</td><td>Return value for the right margin </td></tr> <tr><td class="paramname">top</td><td>Return value for the top margin </td></tr> <tr><td class="paramname">bottom</td><td>Return value for the bottom margin </td></tr> </table> </dd> </dl> <p>Implemented in <a class="el" href="class_qwt_plain_text_engine.html#ac209b74082557d3086cb3b52f99c522d">QwtPlainTextEngine</a>, <a class="el" href="class_qwt_rich_text_engine.html#a3d507f2cad8ce44d0ee5da3070b943ca">QwtRichTextEngine</a>, and <a class="el" href="class_qwt_math_m_l_text_engine.html#ae89278f8e3642851b6357e34763008fe">QwtMathMLTextEngine</a>.</p> </div> </div> <a class="anchor" id="ad9382cc8ff22c6b3e448fce566a76178"></a><!-- doxytag: member="QwtTextEngine::textSize" ref="ad9382cc8ff22c6b3e448fce566a76178" args="(const QFont &font, int flags, const QString &text) const =0" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">virtual QSizeF QwtTextEngine::textSize </td> <td>(</td> <td class="paramtype">const QFont & </td> <td class="paramname"><em>font</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">int </td> <td class="paramname"><em>flags</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const QString & </td> <td class="paramname"><em>text</em> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td> const<code> [pure virtual]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Returns the size, that is needed to render text</p> <dl><dt><b>Parameters:</b></dt><dd> <table class="params"> <tr><td class="paramname">font</td><td>Font of the text </td></tr> <tr><td class="paramname">flags</td><td>Bitwise OR of the flags like in for QPainter::drawText </td></tr> <tr><td class="paramname">text</td><td>Text to be rendered</td></tr> </table> </dd> </dl> <dl class="return"><dt><b>Returns:</b></dt><dd>Caluclated size </dd></dl> <p>Implemented in <a class="el" href="class_qwt_plain_text_engine.html#a220628c0e315021a3ae9d4447bf88018">QwtPlainTextEngine</a>, <a class="el" href="class_qwt_rich_text_engine.html#a0dc185454c60931a0c136fc61774abfb">QwtRichTextEngine</a>, and <a class="el" href="class_qwt_math_m_l_text_engine.html#ae2b00277f488f755a3bf7fc19548d0ec">QwtMathMLTextEngine</a>.</p> </div> </div> </div> <hr class="footer"/><address class="footer"><small>Generated by  <a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.3 </small></address> </body> </html>