123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436 |
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://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"/>
- <meta http-equiv="X-UA-Compatible" content="IE=9"/>
- <meta name="generator" content="Doxygen 1.8.20"/>
- <meta name="viewport" content="width=device-width, initial-scale=1"/>
- <title>Qwt User's Guide: QwtTextEngine Class Reference</title>
- <link href="tabs.css" rel="stylesheet" type="text/css"/>
- <script type="text/javascript" src="jquery.js"></script>
- <script type="text/javascript" src="dynsections.js"></script>
- <link href="navtree.css" rel="stylesheet" type="text/css"/>
- <script type="text/javascript" src="resize.js"></script>
- <script type="text/javascript" src="navtreedata.js"></script>
- <script type="text/javascript" src="navtree.js"></script>
- <link href="search/search.css" rel="stylesheet" type="text/css"/>
- <script type="text/javascript" src="search/searchdata.js"></script>
- <script type="text/javascript" src="search/search.js"></script>
- <link href="doxygen.css" rel="stylesheet" type="text/css" />
- </head>
- <body>
- <div id="top"><!-- do not remove this div, it is closed by doxygen! -->
- <div id="titlearea">
- <table cellspacing="0" cellpadding="0">
- <tbody>
- <tr style="height: 56px;">
- <td id="projectalign" style="padding-left: 0.5em;">
- <div id="projectname">Qwt User's Guide
-  <span id="projectnumber">6.1.6</span>
- </div>
- </td>
- </tr>
- </tbody>
- </table>
- </div>
- <!-- end header part -->
- <!-- Generated by Doxygen 1.8.20 -->
- <script type="text/javascript">
- /* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
- var searchBox = new SearchBox("searchBox", "search",false,'Search');
- /* @license-end */
- </script>
- <script type="text/javascript" src="menudata.js"></script>
- <script type="text/javascript" src="menu.js"></script>
- <script type="text/javascript">
- /* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
- $(function() {
- initMenu('',true,false,'search.php','Search');
- $(document).ready(function() { init_search(); });
- });
- /* @license-end */</script>
- <div id="main-nav"></div>
- </div><!-- top -->
- <div id="side-nav" class="ui-resizable side-nav-resizable">
- <div id="nav-tree">
- <div id="nav-tree-contents">
- <div id="nav-sync" class="sync"></div>
- </div>
- </div>
- <div id="splitbar" style="-moz-user-select:none;"
- class="ui-resizable-handle">
- </div>
- </div>
- <script type="text/javascript">
- /* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
- $(document).ready(function(){initNavTree('class_qwt_text_engine.html',''); initResizable(); });
- /* @license-end */
- </script>
- <div id="doc-content">
- <!-- window showing the filter options -->
- <div id="MSearchSelectWindow"
- onmouseover="return searchBox.OnSearchSelectShow()"
- onmouseout="return searchBox.OnSearchSelectHide()"
- onkeydown="return searchBox.OnSearchSelectKey(event)">
- </div>
- <!-- iframe showing the search results (closed by default) -->
- <div id="MSearchResultsWindow">
- <iframe src="javascript:void(0)" frameborder="0"
- name="MSearchResults" id="MSearchResults">
- </iframe>
- </div>
- <div class="header">
- <div class="summary">
- <a href="#pub-methods">Public Member Functions</a> |
- <a href="#pro-methods">Protected Member Functions</a> |
- <a href="class_qwt_text_engine-members.html">List of all members</a> </div>
- <div class="headertitle">
- <div class="title">QwtTextEngine Class Reference<span class="mlabels"><span class="mlabel">abstract</span></span></div> </div>
- </div><!--header-->
- <div class="contents">
- <p>Abstract base class for rendering text strings.
- <a href="class_qwt_text_engine.html#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="#a_qwt_text_engine_inherit__map" alt="Inheritance graph"/></div>
- <map name="_qwt_text_engine_inherit__map" id="a_qwt_text_engine_inherit__map">
- <area shape="rect" title="Abstract base class for rendering text strings." alt="" coords="201,5,311,32"/>
- <area shape="rect" href="class_qwt_math_m_l_text_engine.html" title="Text Engine for the MathML renderer of the Qt solutions package." alt="" coords="5,80,163,107"/>
- <area shape="rect" href="class_qwt_plain_text_engine.html" title="A text engine for plain texts." alt="" coords="187,80,325,107"/>
- <area shape="rect" href="class_qwt_rich_text_engine.html" title="A text engine for Qt rich texts." alt="" coords="349,80,488,107"/>
- </map>
- <center><span class="legend">[<a target="top" href="graph_legend.html">legend</a>]</span></center></div>
- <table class="memberdecls">
- <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
- Public Member Functions</h2></td></tr>
- <tr class="memitem:adda9e23494429c54b3cc3452940fb2bc"><td class="memItemLeft" align="right" valign="top"><a id="adda9e23494429c54b3cc3452940fb2bc"></a>
- virtual </td><td class="memItemRight" valign="bottom"><a class="el" href="class_qwt_text_engine.html#adda9e23494429c54b3cc3452940fb2bc">~QwtTextEngine</a> ()</td></tr>
- <tr class="memdesc:adda9e23494429c54b3cc3452940fb2bc"><td class="mdescLeft"> </td><td class="mdescRight">Destructor. <br /></td></tr>
- <tr class="separator:adda9e23494429c54b3cc3452940fb2bc"><td class="memSeparator" colspan="2"> </td></tr>
- <tr class="memitem:aee891b14d90c817b8c73d551f623cc17"><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 class="separator:aee891b14d90c817b8c73d551f623cc17"><td class="memSeparator" colspan="2"> </td></tr>
- <tr class="memitem:ad9382cc8ff22c6b3e448fce566a76178"><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 class="separator:ad9382cc8ff22c6b3e448fce566a76178"><td class="memSeparator" colspan="2"> </td></tr>
- <tr class="memitem:a98316f2f6f4f50216ceffbe9babe2901"><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 class="separator:a98316f2f6f4f50216ceffbe9babe2901"><td class="memSeparator" colspan="2"> </td></tr>
- <tr class="memitem:a83c8d3dc590b9914e9216c01e78e0838"><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 class="separator:a83c8d3dc590b9914e9216c01e78e0838"><td class="memSeparator" colspan="2"> </td></tr>
- <tr class="memitem:ad727f58f9eebfec86369e7f2e5bf6a59"><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 class="separator:ad727f58f9eebfec86369e7f2e5bf6a59"><td class="memSeparator" colspan="2"> </td></tr>
- </table><table class="memberdecls">
- <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pro-methods"></a>
- Protected Member Functions</h2></td></tr>
- <tr class="memitem:a97c5ef76ee920ab0f19e178e85017d9d"><td class="memItemLeft" align="right" valign="top"><a id="a97c5ef76ee920ab0f19e178e85017d9d"></a>
-  </td><td class="memItemRight" valign="bottom"><a class="el" href="class_qwt_text_engine.html#a97c5ef76ee920ab0f19e178e85017d9d">QwtTextEngine</a> ()</td></tr>
- <tr class="memdesc:a97c5ef76ee920ab0f19e178e85017d9d"><td class="mdescLeft"> </td><td class="mdescRight">Constructor. <br /></td></tr>
- <tr class="separator:a97c5ef76ee920ab0f19e178e85017d9d"><td class="memSeparator" colspan="2"> </td></tr>
- </table>
- <a name="details" id="details"></a><h2 class="groupheader">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="section see"><dt>See also</dt><dd><a class="el" href="class_qwt_text.html#aef6a1e71b1feba3116ce69f6c9de70ad">QwtText::setTextEngine()</a> </dd></dl>
- </div><h2 class="groupheader">Member Function Documentation</h2>
- <a id="ad727f58f9eebfec86369e7f2e5bf6a59"></a>
- <h2 class="memtitle"><span class="permalink"><a href="#ad727f58f9eebfec86369e7f2e5bf6a59">◆ </a></span>draw()</h2>
- <div class="memitem">
- <div class="memproto">
- <table class="mlabels">
- <tr>
- <td class="mlabels-left">
- <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</td>
- </tr>
- </table>
- </td>
- <td class="mlabels-right">
- <span class="mlabels"><span class="mlabel">pure virtual</span></span> </td>
- </tr>
- </table>
- </div><div class="memdoc">
- <p>Draw the text in a clipping rectangle</p>
- <dl class="params"><dt>Parameters</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_math_m_l_text_engine.html#a7d762090045267910dfd579defb6fa29">QwtMathMLTextEngine</a>, <a class="el" href="class_qwt_rich_text_engine.html#a06a4adbfd09b33896c8df14d861311ae">QwtRichTextEngine</a>, and <a class="el" href="class_qwt_plain_text_engine.html#a84d8e3e2a4710d3e1143ca47020f1c4a">QwtPlainTextEngine</a>.</p>
- </div>
- </div>
- <a id="aee891b14d90c817b8c73d551f623cc17"></a>
- <h2 class="memtitle"><span class="permalink"><a href="#aee891b14d90c817b8c73d551f623cc17">◆ </a></span>heightForWidth()</h2>
- <div class="memitem">
- <div class="memproto">
- <table class="mlabels">
- <tr>
- <td class="mlabels-left">
- <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</td>
- </tr>
- </table>
- </td>
- <td class="mlabels-right">
- <span class="mlabels"><span class="mlabel">pure virtual</span></span> </td>
- </tr>
- </table>
- </div><div class="memdoc">
- <p>Find the height for a given width</p>
- <dl class="params"><dt>Parameters</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="section return"><dt>Returns</dt><dd>Calculated height </dd></dl>
- <p>Implemented in <a class="el" href="class_qwt_math_m_l_text_engine.html#a9b9d72be4816b901acd3a9e3e8754712">QwtMathMLTextEngine</a>, <a class="el" href="class_qwt_rich_text_engine.html#aba12fcba7303a187128cb01d06ecb382">QwtRichTextEngine</a>, and <a class="el" href="class_qwt_plain_text_engine.html#ac5cedc0d644433b2ff14b3740996eb7d">QwtPlainTextEngine</a>.</p>
- </div>
- </div>
- <a id="a98316f2f6f4f50216ceffbe9babe2901"></a>
- <h2 class="memtitle"><span class="permalink"><a href="#a98316f2f6f4f50216ceffbe9babe2901">◆ </a></span>mightRender()</h2>
- <div class="memitem">
- <div class="memproto">
- <table class="mlabels">
- <tr>
- <td class="mlabels-left">
- <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</td>
- </tr>
- </table>
- </td>
- <td class="mlabels-right">
- <span class="mlabels"><span class="mlabel">pure virtual</span></span> </td>
- </tr>
- </table>
- </div><div class="memdoc">
- <p>Test if a string can be rendered by this text engine</p>
- <dl class="params"><dt>Parameters</dt><dd>
- <table class="params">
- <tr><td class="paramname">text</td><td>Text to be tested </td></tr>
- </table>
- </dd>
- </dl>
- <dl class="section return"><dt>Returns</dt><dd>true, if it can be rendered </dd></dl>
- <p>Implemented in <a class="el" href="class_qwt_math_m_l_text_engine.html#adbb0723b8a7f8ab9ff612d062d5f053b">QwtMathMLTextEngine</a>, <a class="el" href="class_qwt_rich_text_engine.html#a597cd0341d44bc364dab2f5e70cd0674">QwtRichTextEngine</a>, and <a class="el" href="class_qwt_plain_text_engine.html#ad210b32f1218447fcff3dafafd0a9fb9">QwtPlainTextEngine</a>.</p>
- </div>
- </div>
- <a id="a83c8d3dc590b9914e9216c01e78e0838"></a>
- <h2 class="memtitle"><span class="permalink"><a href="#a83c8d3dc590b9914e9216c01e78e0838">◆ </a></span>textMargins()</h2>
- <div class="memitem">
- <div class="memproto">
- <table class="mlabels">
- <tr>
- <td class="mlabels-left">
- <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</td>
- </tr>
- </table>
- </td>
- <td class="mlabels-right">
- <span class="mlabels"><span class="mlabel">pure virtual</span></span> </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 aligned in detail, knowing these margins might improve the layout calculations.</p>
- <dl class="params"><dt>Parameters</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_math_m_l_text_engine.html#a7ae2e9d5cd4f841baf746652aa24042c">QwtMathMLTextEngine</a>, <a class="el" href="class_qwt_rich_text_engine.html#a8aaca45963ed5ab76bfe6161e0ebc964">QwtRichTextEngine</a>, and <a class="el" href="class_qwt_plain_text_engine.html#a4ed2a4aa7574f1badc88a3118a0de502">QwtPlainTextEngine</a>.</p>
- </div>
- </div>
- <a id="ad9382cc8ff22c6b3e448fce566a76178"></a>
- <h2 class="memtitle"><span class="permalink"><a href="#ad9382cc8ff22c6b3e448fce566a76178">◆ </a></span>textSize()</h2>
- <div class="memitem">
- <div class="memproto">
- <table class="mlabels">
- <tr>
- <td class="mlabels-left">
- <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</td>
- </tr>
- </table>
- </td>
- <td class="mlabels-right">
- <span class="mlabels"><span class="mlabel">pure virtual</span></span> </td>
- </tr>
- </table>
- </div><div class="memdoc">
- <p>Returns the size, that is needed to render text</p>
- <dl class="params"><dt>Parameters</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="section return"><dt>Returns</dt><dd>Calculated size </dd></dl>
- <p>Implemented in <a class="el" href="class_qwt_math_m_l_text_engine.html#a82ca1c89927b32a32829680e4be63001">QwtMathMLTextEngine</a>, <a class="el" href="class_qwt_rich_text_engine.html#ad644bf615cf2f27bc51e941d9bdcb509">QwtRichTextEngine</a>, and <a class="el" href="class_qwt_plain_text_engine.html#ab4937c7b9d44aa4d1cc5dcd1d7740b3b">QwtPlainTextEngine</a>.</p>
- </div>
- </div>
- </div><!-- contents -->
- </div><!-- doc-content -->
- <!-- start footer part -->
- <div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
- <ul>
- <li class="navelem"><a class="el" href="class_qwt_text_engine.html">QwtTextEngine</a></li>
- <li class="footer">Generated by <a href="http://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.8.20 </li>
- </ul>
- </div>
- </body>
- </html>
|