1
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
3
<title>Qwt User's Guide: QwtTextEngine Class Reference</title>
4
<link href="doxygen.css" rel="stylesheet" type="text/css">
5
<link href="tabs.css" rel="stylesheet" type="text/css">
7
<!-- Generated by Doxygen 1.4.6 -->
10
<li><a href="index.html"><span>Main Page</span></a></li>
11
<li id="current"><a href="classes.html"><span>Classes</span></a></li>
12
<li><a href="files.html"><span>Files</span></a></li>
13
<li><a href="pages.html"><span>Related Pages</span></a></li>
17
<li><a href="classes.html"><span>Alphabetical List</span></a></li>
18
<li><a href="annotated.html"><span>Class List</span></a></li>
19
<li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li>
20
<li><a href="functions.html"><span>Class Members</span></a></li>
22
<h1>QwtTextEngine Class Reference</h1><!-- doxytag: class="QwtTextEngine" -->Inheritance diagram for QwtTextEngine:<p><center><img src="class_qwt_text_engine__inherit__graph.png" border="0" usemap="#_qwt_text_engine__inherit__map" alt="Inheritance graph"></center>
23
<map name="_qwt_text_engine__inherit__map">
24
<area href="class_qwt_math_m_l_text_engine.html" shape="rect" coords="7,83,164,107" alt="">
25
<area href="class_qwt_plain_text_engine.html" shape="rect" coords="188,83,327,107" alt="">
26
<area href="class_qwt_rich_text_engine.html" shape="rect" coords="351,83,489,107" alt="">
28
<center><font size="2">[<a href="graph_legend.html">legend</a>]</font></center><a href="class_qwt_text_engine-members.html">List of all members.</a><hr><a name="_details"></a><h2>Detailed Description</h2>
29
Abstract base class for rendering text strings.
31
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">QwtText</a> to render a text.<p>
32
<a class="el" href="class_qwt_plain_text_engine.html">QwtPlainTextEngine</a> and <a class="el" href="class_qwt_rich_text_engine.html">QwtRichTextEngine</a> are part of the Qwt library.<p>
33
<a class="el" href="class_qwt_math_m_l_text_engine.html">QwtMathMLTextEngine</a> can be found in Qwt MathML extension, that needs the MathML renderer of the Qt solutions package. Unfortunately it is only available with a commercial Qt license.<p>
34
<dl compact><dt><b>See also:</b></dt><dd><a class="el" href="class_qwt_text.html#ef6a1e71b1feba3116ce69f6c9de70ad">QwtText::setTextEngine</a> </dd></dl>
39
Definition at line <a class="el" href="qwt__text__engine_8h-source.html#l00038">38</a> of file <a class="el" href="qwt__text__engine_8h-source.html">qwt_text_engine.h</a>.<table border="0" cellpadding="0" cellspacing="0">
41
<tr><td colspan="2"><br><h2>Public Member Functions</h2></td></tr>
42
<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual </td><td class="memItemRight" valign="bottom"><a class="el" href="class_qwt_text_engine.html#dda9e23494429c54b3cc3452940fb2bc">~QwtTextEngine</a> ()</td></tr>
44
<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual int </td><td class="memItemRight" valign="bottom"><a class="el" href="class_qwt_text_engine.html#ac1112e5b1005d020d596dd174bbabf6">heightForWidth</a> (const QFont &font, int flags, const QString &text, int width) const =0</td></tr>
46
<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual QSize </td><td class="memItemRight" valign="bottom"><a class="el" href="class_qwt_text_engine.html#73214e1778edf6eb870fc96bf9c5091e">textSize</a> (const QFont &font, int flags, const QString &text) const =0</td></tr>
48
<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual bool </td><td class="memItemRight" valign="bottom"><a class="el" href="class_qwt_text_engine.html#98316f2f6f4f50216ceffbe9babe2901">mightRender</a> (const QString &text) const =0</td></tr>
50
<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><a class="el" href="class_qwt_text_engine.html#d84ebda640e65f23ebd758cd545a5b9a">textMargins</a> (const QFont &font, const QString &text, int &left, int &right, int &top, int &bottom) const =0</td></tr>
52
<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><a class="el" href="class_qwt_text_engine.html#cf750dd01aa35f5c9fc836460c30d663">draw</a> (QPainter *painter, const QRect &rect, int flags, const QString &text) const =0</td></tr>
54
<tr><td colspan="2"><br><h2>Protected Member Functions</h2></td></tr>
55
<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="class_qwt_text_engine.html#97c5ef76ee920ab0f19e178e85017d9d">QwtTextEngine</a> ()</td></tr>
58
<hr><h2>Constructor & Destructor Documentation</h2>
59
<a class="anchor" name="dda9e23494429c54b3cc3452940fb2bc"></a><!-- doxytag: member="QwtTextEngine::~QwtTextEngine" ref="dda9e23494429c54b3cc3452940fb2bc" args="()" --><p>
60
<table class="mdTable" cellpadding="2" cellspacing="0">
63
<table cellpadding="0" cellspacing="0" border="0">
65
<td class="md" nowrap valign="top">QwtTextEngine::~QwtTextEngine </td>
66
<td class="md" valign="top">( </td>
67
<td class="mdname1" valign="top" nowrap> </td>
68
<td class="md" valign="top"> ) </td>
69
<td class="md" nowrap><code> [virtual]</code></td>
75
<table cellspacing="5" cellpadding="0" border="0">
87
Definition at line <a class="el" href="qwt__text__engine_8cpp-source.html#l00129">129</a> of file <a class="el" href="qwt__text__engine_8cpp-source.html">qwt_text_engine.cpp</a>. </td>
90
<a class="anchor" name="97c5ef76ee920ab0f19e178e85017d9d"></a><!-- doxytag: member="QwtTextEngine::QwtTextEngine" ref="97c5ef76ee920ab0f19e178e85017d9d" args="()" --><p>
91
<table class="mdTable" cellpadding="2" cellspacing="0">
94
<table cellpadding="0" cellspacing="0" border="0">
96
<td class="md" nowrap valign="top">QwtTextEngine::QwtTextEngine </td>
97
<td class="md" valign="top">( </td>
98
<td class="mdname1" valign="top" nowrap> </td>
99
<td class="md" valign="top"> ) </td>
100
<td class="md" nowrap><code> [protected]</code></td>
106
<table cellspacing="5" cellpadding="0" border="0">
118
Definition at line <a class="el" href="qwt__text__engine_8cpp-source.html#l00124">124</a> of file <a class="el" href="qwt__text__engine_8cpp-source.html">qwt_text_engine.cpp</a>. </td>
121
<hr><h2>Member Function Documentation</h2>
122
<a class="anchor" name="cf750dd01aa35f5c9fc836460c30d663"></a><!-- doxytag: member="QwtTextEngine::draw" ref="cf750dd01aa35f5c9fc836460c30d663" args="(QPainter *painter, const QRect &rect, int flags, const QString &text) const =0" --><p>
123
<table class="mdTable" cellpadding="2" cellspacing="0">
126
<table cellpadding="0" cellspacing="0" border="0">
128
<td class="md" nowrap valign="top">virtual void QwtTextEngine::draw </td>
129
<td class="md" valign="top">( </td>
130
<td class="md" nowrap valign="top">QPainter * </td>
131
<td class="mdname" nowrap> <em>painter</em>, </td>
134
<td class="md" nowrap align="right"></td>
136
<td class="md" nowrap>const QRect & </td>
137
<td class="mdname" nowrap> <em>rect</em>, </td>
140
<td class="md" nowrap align="right"></td>
142
<td class="md" nowrap>int </td>
143
<td class="mdname" nowrap> <em>flags</em>, </td>
146
<td class="md" nowrap align="right"></td>
148
<td class="md" nowrap>const QString & </td>
149
<td class="mdname" nowrap> <em>text</em></td>
153
<td class="md">) </td>
154
<td class="md" colspan="2"> const<code> [pure virtual]</code></td>
160
<table cellspacing="5" cellpadding="0" border="0">
168
Draw the text in a clipping rectangle<p>
169
<dl compact><dt><b>Parameters:</b></dt><dd>
170
<table border="0" cellspacing="2" cellpadding="0">
171
<tr><td valign="top"></td><td valign="top"><em>painter</em> </td><td>Painter </td></tr>
172
<tr><td valign="top"></td><td valign="top"><em>rect</em> </td><td>Clipping rectangle </td></tr>
173
<tr><td valign="top"></td><td valign="top"><em>flags</em> </td><td>Bitwise OR of the flags like in for QPainter::drawText </td></tr>
174
<tr><td valign="top"></td><td valign="top"><em>text</em> </td><td>Text to be rendered </td></tr>
179
Implemented in <a class="el" href="class_qwt_plain_text_engine.html#d953f35830710b9527ca61d931a3debc">QwtPlainTextEngine</a>, <a class="el" href="class_qwt_rich_text_engine.html#3b22116710e9095a95e2739e84623725">QwtRichTextEngine</a>, and <a class="el" href="class_qwt_math_m_l_text_engine.html#476c19642bf2c69a1abf0021547a1d7e">QwtMathMLTextEngine</a>. </td>
182
<a class="anchor" name="ac1112e5b1005d020d596dd174bbabf6"></a><!-- doxytag: member="QwtTextEngine::heightForWidth" ref="ac1112e5b1005d020d596dd174bbabf6" args="(const QFont &font, int flags, const QString &text, int width) const =0" --><p>
183
<table class="mdTable" cellpadding="2" cellspacing="0">
186
<table cellpadding="0" cellspacing="0" border="0">
188
<td class="md" nowrap valign="top">virtual int QwtTextEngine::heightForWidth </td>
189
<td class="md" valign="top">( </td>
190
<td class="md" nowrap valign="top">const QFont & </td>
191
<td class="mdname" nowrap> <em>font</em>, </td>
194
<td class="md" nowrap align="right"></td>
196
<td class="md" nowrap>int </td>
197
<td class="mdname" nowrap> <em>flags</em>, </td>
200
<td class="md" nowrap align="right"></td>
202
<td class="md" nowrap>const QString & </td>
203
<td class="mdname" nowrap> <em>text</em>, </td>
206
<td class="md" nowrap align="right"></td>
208
<td class="md" nowrap>int </td>
209
<td class="mdname" nowrap> <em>width</em></td>
213
<td class="md">) </td>
214
<td class="md" colspan="2"> const<code> [pure virtual]</code></td>
220
<table cellspacing="5" cellpadding="0" border="0">
228
Find the height for a given width<p>
229
<dl compact><dt><b>Parameters:</b></dt><dd>
230
<table border="0" cellspacing="2" cellpadding="0">
231
<tr><td valign="top"></td><td valign="top"><em>font</em> </td><td>Font of the text </td></tr>
232
<tr><td valign="top"></td><td valign="top"><em>flags</em> </td><td>Bitwise OR of the flags used like in QPainter::drawText </td></tr>
233
<tr><td valign="top"></td><td valign="top"><em>text</em> </td><td>Text to be rendered </td></tr>
234
<tr><td valign="top"></td><td valign="top"><em>width</em> </td><td>Width</td></tr>
237
<dl compact><dt><b>Returns:</b></dt><dd>Calculated height </dd></dl>
240
Implemented in <a class="el" href="class_qwt_plain_text_engine.html#167f419dc7a3a172b59f78c9f480fd0d">QwtPlainTextEngine</a>, <a class="el" href="class_qwt_rich_text_engine.html#ff5b59b422c64eb30230b767675b0b79">QwtRichTextEngine</a>, and <a class="el" href="class_qwt_math_m_l_text_engine.html#2af5e9efb10eee9c28cce50699cdfdab">QwtMathMLTextEngine</a>. </td>
243
<a class="anchor" name="98316f2f6f4f50216ceffbe9babe2901"></a><!-- doxytag: member="QwtTextEngine::mightRender" ref="98316f2f6f4f50216ceffbe9babe2901" args="(const QString &text) const =0" --><p>
244
<table class="mdTable" cellpadding="2" cellspacing="0">
247
<table cellpadding="0" cellspacing="0" border="0">
249
<td class="md" nowrap valign="top">virtual bool QwtTextEngine::mightRender </td>
250
<td class="md" valign="top">( </td>
251
<td class="md" nowrap valign="top">const QString & </td>
252
<td class="mdname1" valign="top" nowrap> <em>text</em> </td>
253
<td class="md" valign="top"> ) </td>
254
<td class="md" nowrap> const<code> [pure virtual]</code></td>
260
<table cellspacing="5" cellpadding="0" border="0">
268
Test if a string can be rendered by this text engine<p>
269
<dl compact><dt><b>Parameters:</b></dt><dd>
270
<table border="0" cellspacing="2" cellpadding="0">
271
<tr><td valign="top"></td><td valign="top"><em>text</em> </td><td>Text to be tested </td></tr>
274
<dl compact><dt><b>Returns:</b></dt><dd>true, if it can be rendered </dd></dl>
277
Implemented in <a class="el" href="class_qwt_plain_text_engine.html#e7bd7417f0173e2d35fe1bf7a514ec9b">QwtPlainTextEngine</a>, <a class="el" href="class_qwt_rich_text_engine.html#42da46eee5fbda55e34b18c64b0b5e0b">QwtRichTextEngine</a>, and <a class="el" href="class_qwt_math_m_l_text_engine.html#59ca5842c32fd12cfd2aeeef5c985600">QwtMathMLTextEngine</a>. </td>
280
<a class="anchor" name="d84ebda640e65f23ebd758cd545a5b9a"></a><!-- doxytag: member="QwtTextEngine::textMargins" ref="d84ebda640e65f23ebd758cd545a5b9a" args="(const QFont &font, const QString &text, int &left, int &right, int &top, int &bottom) const =0" --><p>
281
<table class="mdTable" cellpadding="2" cellspacing="0">
284
<table cellpadding="0" cellspacing="0" border="0">
286
<td class="md" nowrap valign="top">virtual void QwtTextEngine::textMargins </td>
287
<td class="md" valign="top">( </td>
288
<td class="md" nowrap valign="top">const QFont & </td>
289
<td class="mdname" nowrap> <em>font</em>, </td>
292
<td class="md" nowrap align="right"></td>
294
<td class="md" nowrap>const QString & </td>
295
<td class="mdname" nowrap> <em>text</em>, </td>
298
<td class="md" nowrap align="right"></td>
300
<td class="md" nowrap>int & </td>
301
<td class="mdname" nowrap> <em>left</em>, </td>
304
<td class="md" nowrap align="right"></td>
306
<td class="md" nowrap>int & </td>
307
<td class="mdname" nowrap> <em>right</em>, </td>
310
<td class="md" nowrap align="right"></td>
312
<td class="md" nowrap>int & </td>
313
<td class="mdname" nowrap> <em>top</em>, </td>
316
<td class="md" nowrap align="right"></td>
318
<td class="md" nowrap>int & </td>
319
<td class="mdname" nowrap> <em>bottom</em></td>
323
<td class="md">) </td>
324
<td class="md" colspan="2"> const<code> [pure virtual]</code></td>
330
<table cellspacing="5" cellpadding="0" border="0">
338
Return margins around the texts<p>
339
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>
340
<dl compact><dt><b>Parameters:</b></dt><dd>
341
<table border="0" cellspacing="2" cellpadding="0">
342
<tr><td valign="top"></td><td valign="top"><em>font</em> </td><td>Font of the text </td></tr>
343
<tr><td valign="top"></td><td valign="top"><em>text</em> </td><td>Text to be rendered </td></tr>
344
<tr><td valign="top"></td><td valign="top"><em>left</em> </td><td>Return value for the left margin </td></tr>
345
<tr><td valign="top"></td><td valign="top"><em>right</em> </td><td>Return value for the right margin </td></tr>
346
<tr><td valign="top"></td><td valign="top"><em>top</em> </td><td>Return value for the top margin </td></tr>
347
<tr><td valign="top"></td><td valign="top"><em>bottom</em> </td><td>Return value for the bottom margin </td></tr>
352
Implemented in <a class="el" href="class_qwt_plain_text_engine.html#d14b14ba0f38576c7d562e5c5d70d8f3">QwtPlainTextEngine</a>, <a class="el" href="class_qwt_rich_text_engine.html#675bb28d8526fbcdbecc1833edffb980">QwtRichTextEngine</a>, and <a class="el" href="class_qwt_math_m_l_text_engine.html#21ae25c70e4ff79cde60072e4bd75a29">QwtMathMLTextEngine</a>. </td>
355
<a class="anchor" name="73214e1778edf6eb870fc96bf9c5091e"></a><!-- doxytag: member="QwtTextEngine::textSize" ref="73214e1778edf6eb870fc96bf9c5091e" args="(const QFont &font, int flags, const QString &text) const =0" --><p>
356
<table class="mdTable" cellpadding="2" cellspacing="0">
359
<table cellpadding="0" cellspacing="0" border="0">
361
<td class="md" nowrap valign="top">virtual QSize QwtTextEngine::textSize </td>
362
<td class="md" valign="top">( </td>
363
<td class="md" nowrap valign="top">const QFont & </td>
364
<td class="mdname" nowrap> <em>font</em>, </td>
367
<td class="md" nowrap align="right"></td>
369
<td class="md" nowrap>int </td>
370
<td class="mdname" nowrap> <em>flags</em>, </td>
373
<td class="md" nowrap align="right"></td>
375
<td class="md" nowrap>const QString & </td>
376
<td class="mdname" nowrap> <em>text</em></td>
380
<td class="md">) </td>
381
<td class="md" colspan="2"> const<code> [pure virtual]</code></td>
387
<table cellspacing="5" cellpadding="0" border="0">
395
Returns the size, that is needed to render text<p>
396
<dl compact><dt><b>Parameters:</b></dt><dd>
397
<table border="0" cellspacing="2" cellpadding="0">
398
<tr><td valign="top"></td><td valign="top"><em>font</em> </td><td>Font of the text </td></tr>
399
<tr><td valign="top"></td><td valign="top"><em>flags</em> </td><td>Bitwise OR of the flags like in for QPainter::drawText </td></tr>
400
<tr><td valign="top"></td><td valign="top"><em>text</em> </td><td>Text to be rendered</td></tr>
403
<dl compact><dt><b>Returns:</b></dt><dd>Caluclated size </dd></dl>
406
Implemented in <a class="el" href="class_qwt_plain_text_engine.html#3d6bd4659b061733ddfd9b3915077b75">QwtPlainTextEngine</a>, <a class="el" href="class_qwt_rich_text_engine.html#f6232e54a4991dcee4a7b3c783163537">QwtRichTextEngine</a>, and <a class="el" href="class_qwt_math_m_l_text_engine.html#ecb16b442a1ff15418dc31860e11c27b">QwtMathMLTextEngine</a>. </td>
409
<hr size="1"><address style="align: right;"><small>Generated on Mon Jun 11 07:43:01 2007 for Qwt User's Guide by
410
<a href="http://www.doxygen.org/index.html">
411
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.6 </small></address>