~oif-team/ubuntu/natty/qt4-x11/xi2.1

« back to all changes in this revision

Viewing changes to doc/html/qtextlayout.html

  • Committer: Bazaar Package Importer
  • Author(s): Alessandro Ghersi
  • Date: 2009-11-02 18:30:08 UTC
  • mfrom: (1.2.2 upstream)
  • mto: (15.2.5 experimental)
  • mto: This revision was merged to the branch mainline in revision 88.
  • Revision ID: james.westby@ubuntu.com-20091102183008-b6a4gcs128mvfb3m
Tags: upstream-4.6.0~beta1
ImportĀ upstreamĀ versionĀ 4.6.0~beta1

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
<!DOCTYPE html
3
3
    PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
4
4
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
5
 
<!-- /fasttmp/mkdist-qt-4.5.2-1245473805/qt-x11-opensource-src-4.5.2/src/gui/text/qtextlayout.cpp -->
 
5
<!-- qtextlayout.cpp -->
6
6
<head>
7
 
  <title>Qt 4.5: QTextLayout Class Reference</title>
 
7
  <title>Qt 4.6: QTextLayout Class Reference</title>
8
8
  <link href="classic.css" rel="stylesheet" type="text/css" />
9
9
</head>
10
10
<body>
 
11
<a name="//apple_ref/cpp/cl//QTextLayout" />
11
12
<table border="0" cellpadding="0" cellspacing="0" width="100%">
12
13
<tr>
13
 
<td align="left" valign="top" width="32"><a href="http://qtsoftware.com/products/qt"><img src="images/qt-logo.png" align="left" border="0" /></a></td>
14
 
<td width="1">&nbsp;&nbsp;</td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a>&nbsp;&middot; <a href="namespaces.html"><font color="#004faf">All&nbsp;Namespaces</font></a>&nbsp;&middot; <a href="classes.html"><font color="#004faf">All&nbsp;Classes</font></a>&nbsp;&middot; <a href="mainclasses.html"><font color="#004faf">Main&nbsp;Classes</font></a>&nbsp;&middot; <a href="groups.html"><font color="#004faf">Grouped&nbsp;Classes</font></a>&nbsp;&middot; <a href="modules.html"><font color="#004faf">Modules</font></a>&nbsp;&middot; <a href="functions.html"><font color="#004faf">Functions</font></a></td>
15
 
<td align="right" valign="top" width="230"></td></tr></table><h1 class="title">QTextLayout Class Reference<br /><span class="small-subtitle">[<a href="qtgui.html">QtGui</a> module]</span>
 
14
<td align="left" valign="top" width="32"><a href="http://qt.nokia.com/"><img src="images/qt-logo.png" align="left" border="0" /></a></td>
 
15
<td width="1">&nbsp;&nbsp;</td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a>&nbsp;&middot; <a href="classes.html"><font color="#004faf">All&nbsp;Classes</font></a>&nbsp;&middot; <a href="functions.html"><font color="#004faf">All&nbsp;Functions</font></a>&nbsp;&middot; <a href="overviews.html"><font color="#004faf">Overviews</font></a></td><td class="searchBar" align="right" valign="center"><form action="http://www.google.com/cse" id="cse-search-box"><div><input type="hidden" name="cx" value="000136343326384750312:dhbxnqlakyu" /><input type="hidden" name="ie" value="UTF-8" /><input type="text" name="q" size="31" /><input type="submit" name="sa" value="Search" /></div></form></td>
 
16
</tr></table><h1 class="title">QTextLayout Class Reference<br /><span class="small-subtitle">[<a href="qtgui.html">QtGui</a> module]</span>
16
17
</h1>
17
18
<p>The QTextLayout class is used to lay out and paint a single paragraph of text. <a href="#details">More...</a></p>
18
 
<pre> #include &lt;QTextLayout&gt;</pre><p><b>Note:</b> All the functions in this class are <a href="threads.html#reentrant">reentrant</a>.</p>
 
19
<pre> #include &lt;QTextLayout&gt;</pre><p><b>Note:</b> All functions in this class are <a href="threads-reentrancy.html#reentrant">reentrant</a>.</p>
19
20
<ul>
20
21
<li><a href="qtextlayout-members.html">List of all members, including inherited members</a></li>
21
22
</ul>
 
23
<hr />
22
24
<a name="public-types"></a>
23
 
<h3>Public Types</h3>
24
 
<ul>
25
 
<li><div class="fn"></div>class <b><a href="qtextlayout-formatrange.html">FormatRange</a></b></li>
26
 
<li><div class="fn"></div>enum <b><a href="qtextlayout.html#CursorMode-enum">CursorMode</a></b> { SkipCharacters, SkipWords }</li>
27
 
</ul>
 
25
<h2>Public Types</h2>
 
26
<table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%">
 
27
<tr><td class="memItemLeft" align="right" valign="top">class </td><td class="memItemRight" valign="bottom"><b><a href="qtextlayout-formatrange.html">FormatRange</a></b></td></tr>
 
28
<tr><td class="memItemLeft" align="right" valign="top">enum </td><td class="memItemRight" valign="bottom"><b><a href="qtextlayout.html#CursorMode-enum">CursorMode</a></b> { SkipCharacters, SkipWords }</td></tr>
 
29
</table>
 
30
<hr />
28
31
<a name="public-functions"></a>
29
 
<h3>Public Functions</h3>
30
 
<ul>
31
 
<li><div class="fn"></div><b><a href="qtextlayout.html#QTextLayout">QTextLayout</a></b> ()</li>
32
 
<li><div class="fn"></div><b><a href="qtextlayout.html#QTextLayout-2">QTextLayout</a></b> ( const QString &amp; <i>text</i> )</li>
33
 
<li><div class="fn"></div><b><a href="qtextlayout.html#QTextLayout-3">QTextLayout</a></b> ( const QString &amp; <i>text</i>, const QFont &amp; <i>font</i>, QPaintDevice * <i>paintdevice</i> = 0 )</li>
34
 
<li><div class="fn"></div><b><a href="qtextlayout.html#dtor.QTextLayout">~QTextLayout</a></b> ()</li>
35
 
<li><div class="fn"></div>QList&lt;FormatRange&gt; <b><a href="qtextlayout.html#additionalFormats">additionalFormats</a></b> () const</li>
36
 
<li><div class="fn"></div>void <b><a href="qtextlayout.html#beginLayout">beginLayout</a></b> ()</li>
37
 
<li><div class="fn"></div>QRectF <b><a href="qtextlayout.html#boundingRect">boundingRect</a></b> () const</li>
38
 
<li><div class="fn"></div>bool <b><a href="qtextlayout.html#cacheEnabled">cacheEnabled</a></b> () const</li>
39
 
<li><div class="fn"></div>void <b><a href="qtextlayout.html#clearAdditionalFormats">clearAdditionalFormats</a></b> ()</li>
40
 
<li><div class="fn"></div>void <b><a href="qtextlayout.html#clearLayout">clearLayout</a></b> ()</li>
41
 
<li><div class="fn"></div>QTextLine <b><a href="qtextlayout.html#createLine">createLine</a></b> ()</li>
42
 
<li><div class="fn"></div>void <b><a href="qtextlayout.html#draw">draw</a></b> ( QPainter * <i>p</i>, const QPointF &amp; <i>pos</i>, const QVector&lt;FormatRange&gt; &amp; <i>selections</i> = QVector&lt;FormatRange&gt; (), const QRectF &amp; <i>clip</i> = QRectF() ) const</li>
43
 
<li><div class="fn"></div>void <b><a href="qtextlayout.html#drawCursor">drawCursor</a></b> ( QPainter * <i>painter</i>, const QPointF &amp; <i>position</i>, int <i>cursorPosition</i>, int <i>width</i> ) const</li>
44
 
<li><div class="fn"></div>void <b><a href="qtextlayout.html#drawCursor-2">drawCursor</a></b> ( QPainter * <i>painter</i>, const QPointF &amp; <i>position</i>, int <i>cursorPosition</i> ) const</li>
45
 
<li><div class="fn"></div>void <b><a href="qtextlayout.html#endLayout">endLayout</a></b> ()</li>
46
 
<li><div class="fn"></div>QFont <b><a href="qtextlayout.html#font">font</a></b> () const</li>
47
 
<li><div class="fn"></div>bool <b><a href="qtextlayout.html#isValidCursorPosition">isValidCursorPosition</a></b> ( int <i>pos</i> ) const</li>
48
 
<li><div class="fn"></div>QTextLine <b><a href="qtextlayout.html#lineAt">lineAt</a></b> ( int <i>i</i> ) const</li>
49
 
<li><div class="fn"></div>int <b><a href="qtextlayout.html#lineCount">lineCount</a></b> () const</li>
50
 
<li><div class="fn"></div>QTextLine <b><a href="qtextlayout.html#lineForTextPosition">lineForTextPosition</a></b> ( int <i>pos</i> ) const</li>
51
 
<li><div class="fn"></div>qreal <b><a href="qtextlayout.html#maximumWidth">maximumWidth</a></b> () const</li>
52
 
<li><div class="fn"></div>qreal <b><a href="qtextlayout.html#minimumWidth">minimumWidth</a></b> () const</li>
53
 
<li><div class="fn"></div>int <b><a href="qtextlayout.html#nextCursorPosition">nextCursorPosition</a></b> ( int <i>oldPos</i>, CursorMode <i>mode</i> = SkipCharacters ) const</li>
54
 
<li><div class="fn"></div>QPointF <b><a href="qtextlayout.html#position">position</a></b> () const</li>
55
 
<li><div class="fn"></div>int <b><a href="qtextlayout.html#preeditAreaPosition">preeditAreaPosition</a></b> () const</li>
56
 
<li><div class="fn"></div>QString <b><a href="qtextlayout.html#preeditAreaText">preeditAreaText</a></b> () const</li>
57
 
<li><div class="fn"></div>int <b><a href="qtextlayout.html#previousCursorPosition">previousCursorPosition</a></b> ( int <i>oldPos</i>, CursorMode <i>mode</i> = SkipCharacters ) const</li>
58
 
<li><div class="fn"></div>void <b><a href="qtextlayout.html#setAdditionalFormats">setAdditionalFormats</a></b> ( const QList&lt;FormatRange&gt; &amp; <i>formatList</i> )</li>
59
 
<li><div class="fn"></div>void <b><a href="qtextlayout.html#setCacheEnabled">setCacheEnabled</a></b> ( bool <i>enable</i> )</li>
60
 
<li><div class="fn"></div>void <b><a href="qtextlayout.html#setFont">setFont</a></b> ( const QFont &amp; <i>font</i> )</li>
61
 
<li><div class="fn"></div>void <b><a href="qtextlayout.html#setPosition">setPosition</a></b> ( const QPointF &amp; <i>p</i> )</li>
62
 
<li><div class="fn"></div>void <b><a href="qtextlayout.html#setPreeditArea">setPreeditArea</a></b> ( int <i>position</i>, const QString &amp; <i>text</i> )</li>
63
 
<li><div class="fn"></div>void <b><a href="qtextlayout.html#setText">setText</a></b> ( const QString &amp; <i>string</i> )</li>
64
 
<li><div class="fn"></div>void <b><a href="qtextlayout.html#setTextOption">setTextOption</a></b> ( const QTextOption &amp; <i>option</i> )</li>
65
 
<li><div class="fn"></div>QString <b><a href="qtextlayout.html#text">text</a></b> () const</li>
66
 
<li><div class="fn"></div>QTextOption <b><a href="qtextlayout.html#textOption">textOption</a></b> () const</li>
67
 
</ul>
 
32
<h2>Public Functions</h2>
 
33
<table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%">
 
34
<tr><td class="memItemLeft" align="right" valign="top"></td><td class="memItemRight" valign="bottom"><b><a href="qtextlayout.html#QTextLayout">QTextLayout</a></b> ()</td></tr>
 
35
<tr><td class="memItemLeft" align="right" valign="top"></td><td class="memItemRight" valign="bottom"><b><a href="qtextlayout.html#QTextLayout-2">QTextLayout</a></b> ( const QString &amp; <i>text</i> )</td></tr>
 
36
<tr><td class="memItemLeft" align="right" valign="top"></td><td class="memItemRight" valign="bottom"><b><a href="qtextlayout.html#QTextLayout-3">QTextLayout</a></b> ( const QString &amp; <i>text</i>, const QFont &amp; <i>font</i>, QPaintDevice * <i>paintdevice</i> = 0 )</td></tr>
 
37
<tr><td class="memItemLeft" align="right" valign="top"></td><td class="memItemRight" valign="bottom"><b><a href="qtextlayout.html#dtor.QTextLayout">~QTextLayout</a></b> ()</td></tr>
 
38
<tr><td class="memItemLeft" align="right" valign="top">QList&lt;FormatRange&gt; </td><td class="memItemRight" valign="bottom"><b><a href="qtextlayout.html#additionalFormats">additionalFormats</a></b> () const</td></tr>
 
39
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="qtextlayout.html#beginLayout">beginLayout</a></b> ()</td></tr>
 
40
<tr><td class="memItemLeft" align="right" valign="top">QRectF </td><td class="memItemRight" valign="bottom"><b><a href="qtextlayout.html#boundingRect">boundingRect</a></b> () const</td></tr>
 
41
<tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><b><a href="qtextlayout.html#cacheEnabled">cacheEnabled</a></b> () const</td></tr>
 
42
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="qtextlayout.html#clearAdditionalFormats">clearAdditionalFormats</a></b> ()</td></tr>
 
43
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="qtextlayout.html#clearLayout">clearLayout</a></b> ()</td></tr>
 
44
<tr><td class="memItemLeft" align="right" valign="top">QTextLine </td><td class="memItemRight" valign="bottom"><b><a href="qtextlayout.html#createLine">createLine</a></b> ()</td></tr>
 
45
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="qtextlayout.html#draw">draw</a></b> ( QPainter * <i>p</i>, const QPointF &amp; <i>pos</i>, const QVector&lt;FormatRange&gt; &amp; <i>selections</i> = QVector&lt;FormatRange&gt; (), const QRectF &amp; <i>clip</i> = QRectF() ) const</td></tr>
 
46
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="qtextlayout.html#drawCursor">drawCursor</a></b> ( QPainter * <i>painter</i>, const QPointF &amp; <i>position</i>, int <i>cursorPosition</i>, int <i>width</i> ) const</td></tr>
 
47
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="qtextlayout.html#drawCursor-2">drawCursor</a></b> ( QPainter * <i>painter</i>, const QPointF &amp; <i>position</i>, int <i>cursorPosition</i> ) const</td></tr>
 
48
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="qtextlayout.html#endLayout">endLayout</a></b> ()</td></tr>
 
49
<tr><td class="memItemLeft" align="right" valign="top">QFont </td><td class="memItemRight" valign="bottom"><b><a href="qtextlayout.html#font">font</a></b> () const</td></tr>
 
50
<tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><b><a href="qtextlayout.html#isValidCursorPosition">isValidCursorPosition</a></b> ( int <i>pos</i> ) const</td></tr>
 
51
<tr><td class="memItemLeft" align="right" valign="top">QTextLine </td><td class="memItemRight" valign="bottom"><b><a href="qtextlayout.html#lineAt">lineAt</a></b> ( int <i>i</i> ) const</td></tr>
 
52
<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><b><a href="qtextlayout.html#lineCount">lineCount</a></b> () const</td></tr>
 
53
<tr><td class="memItemLeft" align="right" valign="top">QTextLine </td><td class="memItemRight" valign="bottom"><b><a href="qtextlayout.html#lineForTextPosition">lineForTextPosition</a></b> ( int <i>pos</i> ) const</td></tr>
 
54
<tr><td class="memItemLeft" align="right" valign="top">qreal </td><td class="memItemRight" valign="bottom"><b><a href="qtextlayout.html#maximumWidth">maximumWidth</a></b> () const</td></tr>
 
55
<tr><td class="memItemLeft" align="right" valign="top">qreal </td><td class="memItemRight" valign="bottom"><b><a href="qtextlayout.html#minimumWidth">minimumWidth</a></b> () const</td></tr>
 
56
<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><b><a href="qtextlayout.html#nextCursorPosition">nextCursorPosition</a></b> ( int <i>oldPos</i>, CursorMode <i>mode</i> = SkipCharacters ) const</td></tr>
 
57
<tr><td class="memItemLeft" align="right" valign="top">QPointF </td><td class="memItemRight" valign="bottom"><b><a href="qtextlayout.html#position">position</a></b> () const</td></tr>
 
58
<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><b><a href="qtextlayout.html#preeditAreaPosition">preeditAreaPosition</a></b> () const</td></tr>
 
59
<tr><td class="memItemLeft" align="right" valign="top">QString </td><td class="memItemRight" valign="bottom"><b><a href="qtextlayout.html#preeditAreaText">preeditAreaText</a></b> () const</td></tr>
 
60
<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><b><a href="qtextlayout.html#previousCursorPosition">previousCursorPosition</a></b> ( int <i>oldPos</i>, CursorMode <i>mode</i> = SkipCharacters ) const</td></tr>
 
61
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="qtextlayout.html#setAdditionalFormats">setAdditionalFormats</a></b> ( const QList&lt;FormatRange&gt; &amp; <i>formatList</i> )</td></tr>
 
62
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="qtextlayout.html#setCacheEnabled">setCacheEnabled</a></b> ( bool <i>enable</i> )</td></tr>
 
63
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="qtextlayout.html#setFont">setFont</a></b> ( const QFont &amp; <i>font</i> )</td></tr>
 
64
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="qtextlayout.html#setPosition">setPosition</a></b> ( const QPointF &amp; <i>p</i> )</td></tr>
 
65
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="qtextlayout.html#setPreeditArea">setPreeditArea</a></b> ( int <i>position</i>, const QString &amp; <i>text</i> )</td></tr>
 
66
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="qtextlayout.html#setText">setText</a></b> ( const QString &amp; <i>string</i> )</td></tr>
 
67
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="qtextlayout.html#setTextOption">setTextOption</a></b> ( const QTextOption &amp; <i>option</i> )</td></tr>
 
68
<tr><td class="memItemLeft" align="right" valign="top">QString </td><td class="memItemRight" valign="bottom"><b><a href="qtextlayout.html#text">text</a></b> () const</td></tr>
 
69
<tr><td class="memItemLeft" align="right" valign="top">QTextOption </td><td class="memItemRight" valign="bottom"><b><a href="qtextlayout.html#textOption">textOption</a></b> () const</td></tr>
 
70
</table>
68
71
<a name="details"></a>
69
72
<hr />
70
73
<h2>Detailed Description</h2>
96
99
<p>The text layout's text is set in the constructor or with <a href="qtextlayout.html#setText">setText</a>(). The layout can be seen as a sequence of <a href="qtextline.html">QTextLine</a> objects; use <a href="qtextlayout.html#lineAt">lineAt</a>() or <a href="qtextlayout.html#lineForTextPosition">lineForTextPosition</a>() to get a <a href="qtextline.html">QTextLine</a>, <a href="qtextlayout.html#createLine">createLine</a>() to create one. For a given position in the text you can find a valid cursor position with <a href="qtextlayout.html#isValidCursorPosition">isValidCursorPosition</a>(), <a href="qtextlayout.html#nextCursorPosition">nextCursorPosition</a>(), and <a href="qtextlayout.html#previousCursorPosition">previousCursorPosition</a>(). The layout itself can be positioned with <a href="qtextlayout.html#setPosition">setPosition</a>(); it has a <a href="qtextlayout.html#boundingRect">boundingRect</a>(), and a <a href="qtextlayout.html#minimumWidth">minimumWidth</a>() and a <a href="qtextlayout.html#maximumWidth">maximumWidth</a>(). A text layout can be drawn on a painter device using <a href="qtextlayout.html#draw">draw</a>().</p>
97
100
<hr />
98
101
<h2>Member Type Documentation</h2>
 
102
<a name="//apple_ref/cpp/tag/QTextLayout/CursorMode" />
 
103
<a name="//apple_ref/cpp/econst/QTextLayout/SkipCharacters" />
 
104
<a name="//apple_ref/cpp/econst/QTextLayout/SkipWords" />
99
105
<h3 class="fn"><a name="CursorMode-enum"></a>enum QTextLayout::CursorMode</h3>
100
 
<p><table border="1" cellpadding="2" cellspacing="1" width="40%">
 
106
<p><table  class="valuelist" border="1" cellpadding="2" cellspacing="1" width="40%">
101
107
<tr><th width="60%">Constant</th><th width="40%">Value</th></tr>
102
108
<tr><td valign="top"><tt>QTextLayout::SkipCharacters</tt></td><td align="center" valign="top"><tt>0</tt></td></tr>
103
109
<tr><td valign="top"><tt>QTextLayout::SkipWords</tt></td><td align="center" valign="top"><tt>1</tt></td></tr>
104
110
</table></p>
105
111
<hr />
106
112
<h2>Member Function Documentation</h2>
 
113
<a name="//apple_ref/cpp/instm/QTextLayout/QTextLayout" />
107
114
<h3 class="fn"><a name="QTextLayout"></a>QTextLayout::QTextLayout ()</h3>
108
115
<p>Constructs an empty text layout.</p>
109
116
<p>See also <a href="qtextlayout.html#setText">setText</a>().</p>
112
119
<h3 class="fn"><a name="QTextLayout-3"></a>QTextLayout::QTextLayout ( const <a href="qstring.html">QString</a> &amp; <i>text</i>, const <a href="qfont.html">QFont</a> &amp; <i>font</i>, <a href="qpaintdevice.html">QPaintDevice</a> * <i>paintdevice</i> = 0 )</h3>
113
120
<p>Constructs a text layout to lay out the given <i>text</i> with the specified <i>font</i>.</p>
114
121
<p>All the metric and layout calculations will be done in terms of the paint device, <i>paintdevice</i>. If <i>paintdevice</i> is 0 the calculations will be done in screen metrics.</p>
 
122
<a name="//apple_ref/cpp/instm/QTextLayout/~QTextLayout" />
115
123
<h3 class="fn"><a name="dtor.QTextLayout"></a>QTextLayout::~QTextLayout ()</h3>
116
124
<p>Destructs the layout.</p>
 
125
<a name="//apple_ref/cpp/instm/QTextLayout/additionalFormats" />
117
126
<h3 class="fn"><a name="additionalFormats"></a><a href="qlist.html">QList</a>&lt;<a href="qtextlayout-formatrange.html">FormatRange</a>&gt; QTextLayout::additionalFormats () const</h3>
118
127
<p>Returns the list of additional formats supported by the text layout.</p>
119
128
<p>See also <a href="qtextlayout.html#setAdditionalFormats">setAdditionalFormats</a>() and <a href="qtextlayout.html#clearAdditionalFormats">clearAdditionalFormats</a>().</p>
 
129
<a name="//apple_ref/cpp/instm/QTextLayout/beginLayout" />
120
130
<h3 class="fn"><a name="beginLayout"></a>void QTextLayout::beginLayout ()</h3>
121
131
<p>Begins the layout process.</p>
 
132
<a name="//apple_ref/cpp/instm/QTextLayout/boundingRect" />
122
133
<h3 class="fn"><a name="boundingRect"></a><a href="qrectf.html">QRectF</a> QTextLayout::boundingRect () const</h3>
123
134
<p>The smallest rectangle that contains all the lines in the layout.</p>
 
135
<a name="//apple_ref/cpp/instm/QTextLayout/cacheEnabled" />
124
136
<h3 class="fn"><a name="cacheEnabled"></a>bool QTextLayout::cacheEnabled () const</h3>
125
137
<p>Returns true if the complete layout information is cached; otherwise returns false.</p>
126
138
<p>See also <a href="qtextlayout.html#setCacheEnabled">setCacheEnabled</a>().</p>
 
139
<a name="//apple_ref/cpp/instm/QTextLayout/clearAdditionalFormats" />
127
140
<h3 class="fn"><a name="clearAdditionalFormats"></a>void QTextLayout::clearAdditionalFormats ()</h3>
128
141
<p>Clears the list of additional formats supported by the text layout.</p>
129
142
<p>See also <a href="qtextlayout.html#additionalFormats">additionalFormats</a>() and <a href="qtextlayout.html#setAdditionalFormats">setAdditionalFormats</a>().</p>
 
143
<a name="//apple_ref/cpp/instm/QTextLayout/clearLayout" />
130
144
<h3 class="fn"><a name="clearLayout"></a>void QTextLayout::clearLayout ()</h3>
131
145
<p>Clears the line information in the layout. After having called this function, <a href="qtextlayout.html#lineCount">lineCount</a>() returns 0.</p>
132
146
<p>This function was introduced in Qt 4.4.</p>
 
147
<a name="//apple_ref/cpp/instm/QTextLayout/createLine" />
133
148
<h3 class="fn"><a name="createLine"></a><a href="qtextline.html">QTextLine</a> QTextLayout::createLine ()</h3>
134
149
<p>Returns a new text line to be laid out if there is text to be inserted into the layout; otherwise returns an invalid text line.</p>
135
150
<p>The text layout creates a new line object that starts after the last line in the layout, or at the beginning if the layout is empty. The layout maintains an internal cursor, and each line is filled with text from the cursor position onwards when the <a href="qtextline.html#setLineWidth">QTextLine::setLineWidth</a>() function is called.</p>
136
151
<p>Once <a href="qtextline.html#setLineWidth">QTextLine::setLineWidth</a>() is called, a new line can be created and filled with text. Repeating this process will lay out the whole block of text contained in the <a href="qtextlayout.html">QTextLayout</a>. If there is no text left to be inserted into the layout, the <a href="qtextline.html">QTextLine</a> returned will not be valid (isValid() will return false).</p>
 
152
<a name="//apple_ref/cpp/instm/QTextLayout/draw" />
137
153
<h3 class="fn"><a name="draw"></a>void QTextLayout::draw ( <a href="qpainter.html">QPainter</a> * <i>p</i>, const <a href="qpointf.html">QPointF</a> &amp; <i>pos</i>, const <a href="qvector.html">QVector</a>&lt;<a href="qtextlayout-formatrange.html">FormatRange</a>&gt; &amp; <i>selections</i> = QVector&lt;FormatRange&gt; (), const <a href="qrectf.html">QRectF</a> &amp; <i>clip</i> = QRectF() ) const</h3>
138
154
<p>Draws the whole layout on the painter <i>p</i> at the position specified by <i>pos</i>. The rendered layout includes the given <i>selections</i> and is clipped within the rectangle specified by <i>clip</i>.</p>
 
155
<a name="//apple_ref/cpp/instm/QTextLayout/drawCursor" />
139
156
<h3 class="fn"><a name="drawCursor"></a>void QTextLayout::drawCursor ( <a href="qpainter.html">QPainter</a> * <i>painter</i>, const <a href="qpointf.html">QPointF</a> &amp; <i>position</i>, int <i>cursorPosition</i>, int <i>width</i> ) const</h3>
140
157
<p>Draws a text cursor with the current pen and the specified <i>width</i> at the given <i>position</i> using the <i>painter</i> specified. The corresponding position within the text is specified by <i>cursorPosition</i>.</p>
141
158
<h3 class="fn"><a name="drawCursor-2"></a>void QTextLayout::drawCursor ( <a href="qpainter.html">QPainter</a> * <i>painter</i>, const <a href="qpointf.html">QPointF</a> &amp; <i>position</i>, int <i>cursorPosition</i> ) const</h3>
142
159
<p>This is an overloaded function.</p>
143
160
<p>Draws a text cursor with the current pen at the given <i>position</i> using the <i>painter</i> specified. The corresponding position within the text is specified by <i>cursorPosition</i>.</p>
 
161
<a name="//apple_ref/cpp/instm/QTextLayout/endLayout" />
144
162
<h3 class="fn"><a name="endLayout"></a>void QTextLayout::endLayout ()</h3>
145
163
<p>Ends the layout process.</p>
 
164
<a name="//apple_ref/cpp/instm/QTextLayout/font" />
146
165
<h3 class="fn"><a name="font"></a><a href="qfont.html">QFont</a> QTextLayout::font () const</h3>
147
166
<p>Returns the current font that is used for the layout, or a default font if none is set.</p>
148
167
<p>See also <a href="qtextlayout.html#setFont">setFont</a>().</p>
 
168
<a name="//apple_ref/cpp/instm/QTextLayout/isValidCursorPosition" />
149
169
<h3 class="fn"><a name="isValidCursorPosition"></a>bool QTextLayout::isValidCursorPosition ( int <i>pos</i> ) const</h3>
150
170
<p>Returns true if position <i>pos</i> is a valid cursor position.</p>
151
171
<p>In a Unicode context some positions in the text are not valid cursor positions, because the position is inside a Unicode surrogate or a grapheme cluster.</p>
152
172
<p>A grapheme cluster is a sequence of two or more Unicode characters that form one indivisible entity on the screen. For example the latin character `&Auml;' can be represented in Unicode by two characters, `A' (0x41), and the combining diaresis (0x308). A text cursor can only validly be positioned before or after these two characters, never between them since that wouldn't make sense. In indic languages every syllable forms a grapheme cluster.</p>
 
173
<a name="//apple_ref/cpp/instm/QTextLayout/lineAt" />
153
174
<h3 class="fn"><a name="lineAt"></a><a href="qtextline.html">QTextLine</a> QTextLayout::lineAt ( int <i>i</i> ) const</h3>
154
175
<p>Returns the <i>i</i>-th line of text in this text layout.</p>
155
176
<p>See also <a href="qtextlayout.html#lineCount">lineCount</a>() and <a href="qtextlayout.html#lineForTextPosition">lineForTextPosition</a>().</p>
 
177
<a name="//apple_ref/cpp/instm/QTextLayout/lineCount" />
156
178
<h3 class="fn"><a name="lineCount"></a>int QTextLayout::lineCount () const</h3>
157
179
<p>Returns the number of lines in this text layout.</p>
158
180
<p>See also <a href="qtextlayout.html#lineAt">lineAt</a>().</p>
 
181
<a name="//apple_ref/cpp/instm/QTextLayout/lineForTextPosition" />
159
182
<h3 class="fn"><a name="lineForTextPosition"></a><a href="qtextline.html">QTextLine</a> QTextLayout::lineForTextPosition ( int <i>pos</i> ) const</h3>
160
183
<p>Returns the line that contains the cursor position specified by <i>pos</i>.</p>
161
184
<p>See also <a href="qtextlayout.html#isValidCursorPosition">isValidCursorPosition</a>() and <a href="qtextlayout.html#lineAt">lineAt</a>().</p>
 
185
<a name="//apple_ref/cpp/instm/QTextLayout/maximumWidth" />
162
186
<h3 class="fn"><a name="maximumWidth"></a><a href="qtglobal.html#qreal-typedef">qreal</a> QTextLayout::maximumWidth () const</h3>
163
187
<p>The maximum width the layout could expand to; this is essentially the width of the entire text.</p>
164
188
<p><b>Warning:</b> This function only returns a valid value after the layout has been done.</p>
165
189
<p>See also <a href="qtextlayout.html#minimumWidth">minimumWidth</a>().</p>
 
190
<a name="//apple_ref/cpp/instm/QTextLayout/minimumWidth" />
166
191
<h3 class="fn"><a name="minimumWidth"></a><a href="qtglobal.html#qreal-typedef">qreal</a> QTextLayout::minimumWidth () const</h3>
167
192
<p>The minimum width the layout needs. This is the width of the layout's smallest non-breakable substring.</p>
168
193
<p><b>Warning:</b> This function only returns a valid value after the layout has been done.</p>
169
194
<p>See also <a href="qtextlayout.html#maximumWidth">maximumWidth</a>().</p>
 
195
<a name="//apple_ref/cpp/instm/QTextLayout/nextCursorPosition" />
170
196
<h3 class="fn"><a name="nextCursorPosition"></a>int QTextLayout::nextCursorPosition ( int <i>oldPos</i>, <a href="qtextlayout.html#CursorMode-enum">CursorMode</a> <i>mode</i> = SkipCharacters ) const</h3>
171
197
<p>Returns the next valid cursor position after <i>oldPos</i> that respects the given cursor <i>mode</i>.</p>
172
198
<p>See also <a href="qtextlayout.html#isValidCursorPosition">isValidCursorPosition</a>() and <a href="qtextlayout.html#previousCursorPosition">previousCursorPosition</a>().</p>
 
199
<a name="//apple_ref/cpp/instm/QTextLayout/position" />
173
200
<h3 class="fn"><a name="position"></a><a href="qpointf.html">QPointF</a> QTextLayout::position () const</h3>
174
201
<p>The global position of the layout. This is independent of the bounding rectangle and of the layout process.</p>
175
202
<p>This function was introduced in Qt 4.2.</p>
176
203
<p>See also <a href="qtextlayout.html#setPosition">setPosition</a>().</p>
 
204
<a name="//apple_ref/cpp/instm/QTextLayout/preeditAreaPosition" />
177
205
<h3 class="fn"><a name="preeditAreaPosition"></a>int QTextLayout::preeditAreaPosition () const</h3>
178
206
<p>Returns the position of the area in the text layout that will be processed before editing occurs.</p>
 
207
<a name="//apple_ref/cpp/instm/QTextLayout/preeditAreaText" />
179
208
<h3 class="fn"><a name="preeditAreaText"></a><a href="qstring.html">QString</a> QTextLayout::preeditAreaText () const</h3>
180
209
<p>Returns the text that is inserted in the layout before editing occurs.</p>
 
210
<a name="//apple_ref/cpp/instm/QTextLayout/previousCursorPosition" />
181
211
<h3 class="fn"><a name="previousCursorPosition"></a>int QTextLayout::previousCursorPosition ( int <i>oldPos</i>, <a href="qtextlayout.html#CursorMode-enum">CursorMode</a> <i>mode</i> = SkipCharacters ) const</h3>
182
212
<p>Returns the first valid cursor position before <i>oldPos</i> that respects the given cursor <i>mode</i>.</p>
183
213
<p>See also <a href="qtextlayout.html#isValidCursorPosition">isValidCursorPosition</a>() and <a href="qtextlayout.html#nextCursorPosition">nextCursorPosition</a>().</p>
 
214
<a name="//apple_ref/cpp/instm/QTextLayout/setAdditionalFormats" />
184
215
<h3 class="fn"><a name="setAdditionalFormats"></a>void QTextLayout::setAdditionalFormats ( const <a href="qlist.html">QList</a>&lt;<a href="qtextlayout-formatrange.html">FormatRange</a>&gt; &amp; <i>formatList</i> )</h3>
185
216
<p>Sets the additional formats supported by the text layout to <i>formatList</i>.</p>
186
217
<p>See also <a href="qtextlayout.html#additionalFormats">additionalFormats</a>() and <a href="qtextlayout.html#clearAdditionalFormats">clearAdditionalFormats</a>().</p>
 
218
<a name="//apple_ref/cpp/instm/QTextLayout/setCacheEnabled" />
187
219
<h3 class="fn"><a name="setCacheEnabled"></a>void QTextLayout::setCacheEnabled ( bool <i>enable</i> )</h3>
188
220
<p>Enables caching of the complete layout information if <i>enable</i> is true; otherwise disables layout caching. Usually <a href="qtextlayout.html">QTextLayout</a> throws most of the layouting information away after a call to <a href="qtextlayout.html#endLayout">endLayout</a>() to reduce memory consumption. If you however want to draw the laid out text directly afterwards enabling caching might speed up drawing significantly.</p>
189
221
<p>See also <a href="qtextlayout.html#cacheEnabled">cacheEnabled</a>().</p>
 
222
<a name="//apple_ref/cpp/instm/QTextLayout/setFont" />
190
223
<h3 class="fn"><a name="setFont"></a>void QTextLayout::setFont ( const <a href="qfont.html">QFont</a> &amp; <i>font</i> )</h3>
191
224
<p>Sets the layout's font to the given <i>font</i>. The layout is invalidated and must be laid out again.</p>
192
225
<p>See also <a href="qtextlayout.html#font">font</a>() and <a href="qtextlayout.html#text">text</a>().</p>
 
226
<a name="//apple_ref/cpp/instm/QTextLayout/setPosition" />
193
227
<h3 class="fn"><a name="setPosition"></a>void QTextLayout::setPosition ( const <a href="qpointf.html">QPointF</a> &amp; <i>p</i> )</h3>
194
228
<p>Moves the text layout to point <i>p</i>.</p>
195
229
<p>See also <a href="qtextlayout.html#position">position</a>().</p>
 
230
<a name="//apple_ref/cpp/instm/QTextLayout/setPreeditArea" />
196
231
<h3 class="fn"><a name="setPreeditArea"></a>void QTextLayout::setPreeditArea ( int <i>position</i>, const <a href="qstring.html">QString</a> &amp; <i>text</i> )</h3>
197
232
<p>Sets the <i>position</i> and <i>text</i> of the area in the layout that is processed before editing occurs.</p>
 
233
<a name="//apple_ref/cpp/instm/QTextLayout/setText" />
198
234
<h3 class="fn"><a name="setText"></a>void QTextLayout::setText ( const <a href="qstring.html">QString</a> &amp; <i>string</i> )</h3>
199
235
<p>Sets the layout's text to the given <i>string</i>. The layout is invalidated and must be laid out again.</p>
200
236
<p>Notice that when using this <a href="qtextlayout.html">QTextLayout</a> as part of a <a href="qtextdocument.html">QTextDocument</a> this method will have no effect.</p>
201
237
<p>See also <a href="qtextlayout.html#text">text</a>().</p>
 
238
<a name="//apple_ref/cpp/instm/QTextLayout/setTextOption" />
202
239
<h3 class="fn"><a name="setTextOption"></a>void QTextLayout::setTextOption ( const <a href="qtextoption.html">QTextOption</a> &amp; <i>option</i> )</h3>
203
240
<p>Sets the text option structure that controls the layout process to the given <i>option</i>.</p>
204
241
<p>See also <a href="qtextlayout.html#textOption">textOption</a>() and <a href="qtextoption.html">QTextOption</a>.</p>
 
242
<a name="//apple_ref/cpp/instm/QTextLayout/text" />
205
243
<h3 class="fn"><a name="text"></a><a href="qstring.html">QString</a> QTextLayout::text () const</h3>
206
244
<p>Returns the layout's text.</p>
207
245
<p>See also <a href="qtextlayout.html#setText">setText</a>().</p>
 
246
<a name="//apple_ref/cpp/instm/QTextLayout/textOption" />
208
247
<h3 class="fn"><a name="textOption"></a><a href="qtextoption.html">QTextOption</a> QTextLayout::textOption () const</h3>
209
248
<p>Returns the current text option used to control the layout process.</p>
210
249
<p>See also <a href="qtextlayout.html#setTextOption">setTextOption</a>() and <a href="qtextoption.html">QTextOption</a>.</p>
211
250
<p /><address><hr /><div align="center">
212
251
<table width="100%" cellspacing="0" border="0"><tr class="address">
213
 
<td width="30%" align="left">Copyright &copy; 2009 Nokia Corporation and/or its subsidiary(-ies)</td>
214
 
<td width="40%" align="center"><a href="trademarks.html">Trademarks</a></td>
215
 
<td width="30%" align="right"><div align="right">Qt 4.5.2</div></td>
216
 
</tr></table></div></address></body>
 
252
<td width="40%" align="left">Copyright &copy; 2009 Nokia Corporation and/or its subsidiary(-ies)</td>
 
253
<td width="20%" align="center"><a href="trademarks.html">Trademarks</a></td>
 
254
<td width="40%" align="right"><div align="right">Qt 4.6.0</div></td>
 
255
<script type="text/javascript" src="http://www.google.com/jsapi"></script><script type="text/javascript">google.load("elements", "1", {packages: "transliteration"});</script><script type="text/javascript" src="http://www.google.com/coop/cse/t13n?form=cse-search-box&t13n_langs=en"></script><script type="text/javascript" src="http://www.google.com/coop/cse/brand?form=cse-search-box&lang=en"></script></tr></table></div></address></body>
217
256
</html>