1
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2
<html xmlns="http://www.w3.org/1999/xhtml">
4
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
5
<title>Qwt User's Guide: QwtTextEngine Class Reference</title>
6
<link href="tabs.css" rel="stylesheet" type="text/css"/>
7
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
10
<!-- Generated by Doxygen 1.7.3 -->
13
<table cellspacing="0" cellpadding="0">
15
<tr style="height: 56px;">
16
<td style="padding-left: 0.5em;">
17
<div id="projectname">Qwt User's Guide <span id="projectnumber">6.0.0</span></div>
23
<div id="navrow1" class="tabs">
25
<li><a href="index.html"><span>Main Page</span></a></li>
26
<li><a href="pages.html"><span>Related Pages</span></a></li>
27
<li class="current"><a href="annotated.html"><span>Classes</span></a></li>
28
<li><a href="files.html"><span>Files</span></a></li>
31
<div id="navrow2" class="tabs2">
33
<li><a href="annotated.html"><span>Class List</span></a></li>
34
<li><a href="classes.html"><span>Class Index</span></a></li>
35
<li><a href="inherits.html"><span>Class Hierarchy</span></a></li>
36
<li><a href="functions.html"><span>Class Members</span></a></li>
42
<a href="#pub-methods">Public Member Functions</a> |
43
<a href="#pro-methods">Protected Member Functions</a> </div>
44
<div class="headertitle">
45
<h1>QwtTextEngine Class Reference</h1> </div>
47
<div class="contents">
48
<!-- doxytag: class="QwtTextEngine" -->
49
<p>Abstract base class for rendering text strings.
50
<a href="#_details">More...</a></p>
52
<p><code>#include <<a class="el" href="qwt__text__engine_8h_source.html">qwt_text_engine.h</a>></code></p>
53
<div class="dynheader">
54
Inheritance diagram for QwtTextEngine:</div>
55
<div class="dyncontent">
56
<div class="center"><img src="class_qwt_text_engine__inherit__graph.png" border="0" usemap="#_qwt_text_engine_inherit__map" alt="Inheritance graph"/></div>
57
<map name="_qwt_text_engine_inherit__map" id="_qwt_text_engine_inherit__map">
58
<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,86,160,117"/><area shape="rect" id="node5" href="class_qwt_plain_text_engine.html" title="A text engine for plain texts." alt="" coords="184,86,323,117"/><area shape="rect" id="node7" href="class_qwt_rich_text_engine.html" title="A text engine for Qt rich texts." alt="" coords="347,86,480,117"/></map>
59
<center><span class="legend">[<a href="graph_legend.html">legend</a>]</span></center></div>
61
<p><a href="class_qwt_text_engine-members.html">List of all members.</a></p>
62
<table class="memberdecls">
63
<tr><td colspan="2"><h2><a name="pub-methods"></a>
64
Public Member Functions</h2></td></tr>
65
<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>
66
<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>
67
<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>
68
<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>
69
<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>
70
<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>
71
<tr><td colspan="2"><h2><a name="pro-methods"></a>
72
Protected Member Functions</h2></td></tr>
73
<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>
75
<hr/><a name="_details"></a><h2>Detailed Description</h2>
76
<div class="textblock"><p>Abstract base class for rendering text strings. </p>
77
<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>
78
<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>
79
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="class_qwt_text.html#aef6a1e71b1feba3116ce69f6c9de70ad">QwtText::setTextEngine()</a> </dd></dl>
80
</div><hr/><h2>Constructor & Destructor Documentation</h2>
81
<a class="anchor" id="adda9e23494429c54b3cc3452940fb2bc"></a><!-- doxytag: member="QwtTextEngine::~QwtTextEngine" ref="adda9e23494429c54b3cc3452940fb2bc" args="()" -->
83
<div class="memproto">
84
<table class="memname">
86
<td class="memname">QwtTextEngine::~QwtTextEngine </td>
88
<td class="paramname"></td><td>)</td>
89
<td><code> [virtual]</code></td>
99
<a class="anchor" id="a97c5ef76ee920ab0f19e178e85017d9d"></a><!-- doxytag: member="QwtTextEngine::QwtTextEngine" ref="a97c5ef76ee920ab0f19e178e85017d9d" args="()" -->
100
<div class="memitem">
101
<div class="memproto">
102
<table class="memname">
104
<td class="memname">QwtTextEngine::QwtTextEngine </td>
106
<td class="paramname"></td><td>)</td>
107
<td><code> [protected]</code></td>
117
<hr/><h2>Member Function Documentation</h2>
118
<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" -->
119
<div class="memitem">
120
<div class="memproto">
121
<table class="memname">
123
<td class="memname">virtual void QwtTextEngine::draw </td>
125
<td class="paramtype">QPainter * </td>
126
<td class="paramname"><em>painter</em>, </td>
129
<td class="paramkey"></td>
131
<td class="paramtype">const QRectF & </td>
132
<td class="paramname"><em>rect</em>, </td>
135
<td class="paramkey"></td>
137
<td class="paramtype">int </td>
138
<td class="paramname"><em>flags</em>, </td>
141
<td class="paramkey"></td>
143
<td class="paramtype">const QString & </td>
144
<td class="paramname"><em>text</em> </td>
149
<td></td><td> const<code> [pure virtual]</code></td>
154
<p>Draw the text in a clipping rectangle</p>
155
<dl><dt><b>Parameters:</b></dt><dd>
156
<table class="params">
157
<tr><td class="paramname">painter</td><td>Painter </td></tr>
158
<tr><td class="paramname">rect</td><td>Clipping rectangle </td></tr>
159
<tr><td class="paramname">flags</td><td>Bitwise OR of the flags like in for QPainter::drawText </td></tr>
160
<tr><td class="paramname">text</td><td>Text to be rendered </td></tr>
165
<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>
169
<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" -->
170
<div class="memitem">
171
<div class="memproto">
172
<table class="memname">
174
<td class="memname">virtual double QwtTextEngine::heightForWidth </td>
176
<td class="paramtype">const QFont & </td>
177
<td class="paramname"><em>font</em>, </td>
180
<td class="paramkey"></td>
182
<td class="paramtype">int </td>
183
<td class="paramname"><em>flags</em>, </td>
186
<td class="paramkey"></td>
188
<td class="paramtype">const QString & </td>
189
<td class="paramname"><em>text</em>, </td>
192
<td class="paramkey"></td>
194
<td class="paramtype">double </td>
195
<td class="paramname"><em>width</em> </td>
200
<td></td><td> const<code> [pure virtual]</code></td>
205
<p>Find the height for a given width</p>
206
<dl><dt><b>Parameters:</b></dt><dd>
207
<table class="params">
208
<tr><td class="paramname">font</td><td>Font of the text </td></tr>
209
<tr><td class="paramname">flags</td><td>Bitwise OR of the flags used like in QPainter::drawText </td></tr>
210
<tr><td class="paramname">text</td><td>Text to be rendered </td></tr>
211
<tr><td class="paramname">width</td><td>Width</td></tr>
215
<dl class="return"><dt><b>Returns:</b></dt><dd>Calculated height </dd></dl>
217
<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>
221
<a class="anchor" id="a98316f2f6f4f50216ceffbe9babe2901"></a><!-- doxytag: member="QwtTextEngine::mightRender" ref="a98316f2f6f4f50216ceffbe9babe2901" args="(const QString &text) const =0" -->
222
<div class="memitem">
223
<div class="memproto">
224
<table class="memname">
226
<td class="memname">virtual bool QwtTextEngine::mightRender </td>
228
<td class="paramtype">const QString & </td>
229
<td class="paramname"><em>text</em></td><td>)</td>
230
<td> const<code> [pure virtual]</code></td>
235
<p>Test if a string can be rendered by this text engine</p>
236
<dl><dt><b>Parameters:</b></dt><dd>
237
<table class="params">
238
<tr><td class="paramname">text</td><td>Text to be tested </td></tr>
242
<dl class="return"><dt><b>Returns:</b></dt><dd>true, if it can be rendered </dd></dl>
244
<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>
248
<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" -->
249
<div class="memitem">
250
<div class="memproto">
251
<table class="memname">
253
<td class="memname">virtual void QwtTextEngine::textMargins </td>
255
<td class="paramtype">const QFont & </td>
256
<td class="paramname"><em>font</em>, </td>
259
<td class="paramkey"></td>
261
<td class="paramtype">const QString & </td>
262
<td class="paramname"><em>text</em>, </td>
265
<td class="paramkey"></td>
267
<td class="paramtype">double & </td>
268
<td class="paramname"><em>left</em>, </td>
271
<td class="paramkey"></td>
273
<td class="paramtype">double & </td>
274
<td class="paramname"><em>right</em>, </td>
277
<td class="paramkey"></td>
279
<td class="paramtype">double & </td>
280
<td class="paramname"><em>top</em>, </td>
283
<td class="paramkey"></td>
285
<td class="paramtype">double & </td>
286
<td class="paramname"><em>bottom</em> </td>
291
<td></td><td> const<code> [pure virtual]</code></td>
296
<p>Return margins around the texts</p>
297
<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>
298
<dl><dt><b>Parameters:</b></dt><dd>
299
<table class="params">
300
<tr><td class="paramname">font</td><td>Font of the text </td></tr>
301
<tr><td class="paramname">text</td><td>Text to be rendered </td></tr>
302
<tr><td class="paramname">left</td><td>Return value for the left margin </td></tr>
303
<tr><td class="paramname">right</td><td>Return value for the right margin </td></tr>
304
<tr><td class="paramname">top</td><td>Return value for the top margin </td></tr>
305
<tr><td class="paramname">bottom</td><td>Return value for the bottom margin </td></tr>
310
<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>
314
<a class="anchor" id="ad9382cc8ff22c6b3e448fce566a76178"></a><!-- doxytag: member="QwtTextEngine::textSize" ref="ad9382cc8ff22c6b3e448fce566a76178" args="(const QFont &font, int flags, const QString &text) const =0" -->
315
<div class="memitem">
316
<div class="memproto">
317
<table class="memname">
319
<td class="memname">virtual QSizeF QwtTextEngine::textSize </td>
321
<td class="paramtype">const QFont & </td>
322
<td class="paramname"><em>font</em>, </td>
325
<td class="paramkey"></td>
327
<td class="paramtype">int </td>
328
<td class="paramname"><em>flags</em>, </td>
331
<td class="paramkey"></td>
333
<td class="paramtype">const QString & </td>
334
<td class="paramname"><em>text</em> </td>
339
<td></td><td> const<code> [pure virtual]</code></td>
344
<p>Returns the size, that is needed to render text</p>
345
<dl><dt><b>Parameters:</b></dt><dd>
346
<table class="params">
347
<tr><td class="paramname">font</td><td>Font of the text </td></tr>
348
<tr><td class="paramname">flags</td><td>Bitwise OR of the flags like in for QPainter::drawText </td></tr>
349
<tr><td class="paramname">text</td><td>Text to be rendered</td></tr>
353
<dl class="return"><dt><b>Returns:</b></dt><dd>Caluclated size </dd></dl>
355
<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>
360
<hr class="footer"/><address class="footer"><small>Generated by 
361
<a href="http://www.doxygen.org/index.html">
362
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.3 </small></address>