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

« back to all changes in this revision

Viewing changes to doc/html/qtextformat.html

  • Committer: Bazaar Package Importer
  • Author(s): Adam Conrad
  • Date: 2005-08-24 04:09:09 UTC
  • Revision ID: james.westby@ubuntu.com-20050824040909-xmxe9jfr4a0w5671
Tags: upstream-4.0.0
ImportĀ upstreamĀ versionĀ 4.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?xml version="1.0" encoding="iso-8859-1"?>
 
2
<!DOCTYPE html
 
3
    PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
 
4
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
 
5
<!-- /tmp/qt-4.0.0-espenr-1119621036935/qt-x11-opensource-desktop-4.0.0/src/gui/text/qtextformat.cpp -->
 
6
<head>
 
7
    <title>Qt 4.0: QTextFormat Class Reference</title>
 
8
    <style>h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm; }
 
9
a:link { color: #004faf; text-decoration: none }
 
10
a:visited { color: #672967; text-decoration: none }
 
11
td.postheader { font-family: sans-serif }
 
12
tr.address { font-family: sans-serif }
 
13
body { background: #ffffff; color: black; }</style>
 
14
</head>
 
15
<body>
 
16
<table border="0" cellpadding="0" cellspacing="0" width="100%">
 
17
<tr>
 
18
<td align="left" valign="top" width="32"><img src="images/qt-logo.png" align="left" width="32" height="32" border="0" /></td>
 
19
<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="mainclasses.html"><font color="#004faf">Main&nbsp;Classes</font></a>&nbsp;&middot; <a href="annotated.html"><font color="#004faf">Annotated</font></a>&nbsp;&middot; <a href="groups.html"><font color="#004faf">Grouped&nbsp;Classes</font></a>&nbsp;&middot; <a href="functions.html"><font color="#004faf">Functions</font></a></td>
 
20
<td align="right" valign="top" width="230"><img src="images/trolltech-logo.png" align="right" width="203" height="32" border="0" /></td></tr></table><h1 align="center">QTextFormat Class Reference</h1>
 
21
<p>The QTextFormat class provides formatting information for a <a href="qtextdocument.html">QTextDocument</a>. <a href="#details">More...</a></p>
 
22
<pre>#include &lt;QTextFormat&gt;</pre><p>Part of the <a href="qtgui.html">QtGui</a> module.</p>
 
23
<p>Inherited by <a href="qtextblockformat.html">QTextBlockFormat</a>, <a href="qtextcharformat.html">QTextCharFormat</a>, <a href="qtextframeformat.html">QTextFrameFormat</a>, and <a href="qtextlistformat.html">QTextListFormat</a>.</p>
 
24
<ul>
 
25
<li><a href="qtextformat-members.html">List of all members, including inherited members</a></li>
 
26
</ul>
 
27
<a name="public-types"></a>
 
28
<h3>Public Types</h3>
 
29
<ul>
 
30
<li><div class="fn"/>enum <b><a href="qtextformat.html#FormatType-enum">FormatType</a></b> { InvalidFormat, BlockFormat, CharFormat, ListFormat, ..., UserFormat }</li>
 
31
<li><div class="fn"/>enum <b><a href="qtextformat.html#ObjectTypes-enum">ObjectTypes</a></b> { NoObject, ImageObject, TableObject }</li>
 
32
<li><div class="fn"/>enum <b><a href="qtextformat.html#Property-enum">Property</a></b> { ObjectIndex, CssFloat, LayoutDirection, OutlinePen, ..., UserProperty }</li>
 
33
</ul>
 
34
<a name="public-functions"></a>
 
35
<h3>Public Functions</h3>
 
36
<ul>
 
37
<li><div class="fn"/><b><a href="qtextformat.html#QTextFormat">QTextFormat</a></b> ()</li>
 
38
<li><div class="fn"/><b><a href="qtextformat.html#QTextFormat-2">QTextFormat</a></b> ( int <i>type</i> )</li>
 
39
<li><div class="fn"/><b><a href="qtextformat.html#QTextFormat-3">QTextFormat</a></b> ( const QTextFormat &amp; <i>other</i> )</li>
 
40
<li><div class="fn"/><b><a href="qtextformat.html#dtor.QTextFormat">~QTextFormat</a></b> ()</li>
 
41
<li><div class="fn"/>QBrush <b><a href="qtextformat.html#background">background</a></b> () const</li>
 
42
<li><div class="fn"/>bool <b><a href="qtextformat.html#boolProperty">boolProperty</a></b> ( int <i>propertyId</i> ) const</li>
 
43
<li><div class="fn"/>QBrush <b><a href="qtextformat.html#brushProperty">brushProperty</a></b> ( int <i>propertyId</i> ) const</li>
 
44
<li><div class="fn"/>void <b><a href="qtextformat.html#clearBackground">clearBackground</a></b> ()</li>
 
45
<li><div class="fn"/>void <b><a href="qtextformat.html#clearForeground">clearForeground</a></b> ()</li>
 
46
<li><div class="fn"/>void <b><a href="qtextformat.html#clearProperty">clearProperty</a></b> ( int <i>propertyId</i> )</li>
 
47
<li><div class="fn"/>QColor <b><a href="qtextformat.html#colorProperty">colorProperty</a></b> ( int <i>propertyId</i> ) const</li>
 
48
<li><div class="fn"/>qreal <b><a href="qtextformat.html#doubleProperty">doubleProperty</a></b> ( int <i>propertyId</i> ) const</li>
 
49
<li><div class="fn"/>QBrush <b><a href="qtextformat.html#foreground">foreground</a></b> () const</li>
 
50
<li><div class="fn"/>bool <b><a href="qtextformat.html#hasProperty">hasProperty</a></b> ( int <i>propertyId</i> ) const</li>
 
51
<li><div class="fn"/>int <b><a href="qtextformat.html#intProperty">intProperty</a></b> ( int <i>propertyId</i> ) const</li>
 
52
<li><div class="fn"/>bool <b><a href="qtextformat.html#isBlockFormat">isBlockFormat</a></b> () const</li>
 
53
<li><div class="fn"/>bool <b><a href="qtextformat.html#isCharFormat">isCharFormat</a></b> () const</li>
 
54
<li><div class="fn"/>bool <b><a href="qtextformat.html#isFrameFormat">isFrameFormat</a></b> () const</li>
 
55
<li><div class="fn"/>bool <b><a href="qtextformat.html#isImageFormat">isImageFormat</a></b> () const</li>
 
56
<li><div class="fn"/>bool <b><a href="qtextformat.html#isListFormat">isListFormat</a></b> () const</li>
 
57
<li><div class="fn"/>bool <b><a href="qtextformat.html#isTableFormat">isTableFormat</a></b> () const</li>
 
58
<li><div class="fn"/>bool <b><a href="qtextformat.html#isValid">isValid</a></b> () const</li>
 
59
<li><div class="fn"/>Qt::LayoutDirection <b><a href="qtextformat.html#layoutDirection">layoutDirection</a></b> () const</li>
 
60
<li><div class="fn"/>QTextLength <b><a href="qtextformat.html#lengthProperty">lengthProperty</a></b> ( int <i>propertyId</i> ) const</li>
 
61
<li><div class="fn"/>QVector&lt;QTextLength&gt; <b><a href="qtextformat.html#lengthVectorProperty">lengthVectorProperty</a></b> ( int <i>propertyId</i> ) const</li>
 
62
<li><div class="fn"/>void <b><a href="qtextformat.html#merge">merge</a></b> ( const QTextFormat &amp; <i>other</i> )</li>
 
63
<li><div class="fn"/>int <b><a href="qtextformat.html#objectIndex">objectIndex</a></b> () const</li>
 
64
<li><div class="fn"/>int <b><a href="qtextformat.html#objectType">objectType</a></b> () const</li>
 
65
<li><div class="fn"/>QPen <b><a href="qtextformat.html#penProperty">penProperty</a></b> ( int <i>propertyId</i> ) const</li>
 
66
<li><div class="fn"/>QMap&lt;int, QVariant&gt; <b><a href="qtextformat.html#properties">properties</a></b> () const</li>
 
67
<li><div class="fn"/>QVariant <b><a href="qtextformat.html#property">property</a></b> ( int <i>propertyId</i> ) const</li>
 
68
<li><div class="fn"/>void <b><a href="qtextformat.html#setBackground">setBackground</a></b> ( const QBrush &amp; <i>brush</i> )</li>
 
69
<li><div class="fn"/>void <b><a href="qtextformat.html#setForeground">setForeground</a></b> ( const QBrush &amp; <i>brush</i> )</li>
 
70
<li><div class="fn"/>void <b><a href="qtextformat.html#setLayoutDirection">setLayoutDirection</a></b> ( Qt::LayoutDirection <i>direction</i> )</li>
 
71
<li><div class="fn"/>void <b><a href="qtextformat.html#setObjectIndex">setObjectIndex</a></b> ( int <i>index</i> )</li>
 
72
<li><div class="fn"/>void <b><a href="qtextformat.html#setObjectType">setObjectType</a></b> ( int <i>type</i> )</li>
 
73
<li><div class="fn"/>void <b><a href="qtextformat.html#setProperty">setProperty</a></b> ( int <i>propertyId</i>, const QVariant &amp; <i>value</i> )</li>
 
74
<li><div class="fn"/>void <b><a href="qtextformat.html#setProperty-2">setProperty</a></b> ( int <i>propertyId</i>, const QVector&lt;QTextLength&gt; &amp; <i>value</i> )</li>
 
75
<li><div class="fn"/>QString <b><a href="qtextformat.html#stringProperty">stringProperty</a></b> ( int <i>propertyId</i> ) const</li>
 
76
<li><div class="fn"/>QTextBlockFormat <b><a href="qtextformat.html#toBlockFormat">toBlockFormat</a></b> () const</li>
 
77
<li><div class="fn"/>QTextCharFormat <b><a href="qtextformat.html#toCharFormat">toCharFormat</a></b> () const</li>
 
78
<li><div class="fn"/>QTextFrameFormat <b><a href="qtextformat.html#toFrameFormat">toFrameFormat</a></b> () const</li>
 
79
<li><div class="fn"/>QTextImageFormat <b><a href="qtextformat.html#toImageFormat">toImageFormat</a></b> () const</li>
 
80
<li><div class="fn"/>QTextListFormat <b><a href="qtextformat.html#toListFormat">toListFormat</a></b> () const</li>
 
81
<li><div class="fn"/>QTextTableFormat <b><a href="qtextformat.html#toTableFormat">toTableFormat</a></b> () const</li>
 
82
<li><div class="fn"/>int <b><a href="qtextformat.html#type">type</a></b> () const</li>
 
83
<li><div class="fn"/><b><a href="qtextformat.html#operator-QVariant">operator QVariant</a></b> () const</li>
 
84
<li><div class="fn"/>bool <b><a href="qtextformat.html#operator-not-eq">operator!=</a></b> ( const QTextFormat &amp; <i>other</i> ) const</li>
 
85
<li><div class="fn"/>QTextFormat &amp; <b><a href="qtextformat.html#operator-eq">operator=</a></b> ( const QTextFormat &amp; <i>other</i> )</li>
 
86
<li><div class="fn"/>bool <b><a href="qtextformat.html#operator-eq-eq">operator==</a></b> ( const QTextFormat &amp; <i>other</i> ) const</li>
 
87
</ul>
 
88
<a name="details"></a>
 
89
<hr />
 
90
<h2>Detailed Description</h2>
 
91
<p>The QTextFormat class provides formatting information for a <a href="qtextdocument.html">QTextDocument</a>.</p>
 
92
<p>A QTextFormat is a generic class used for describing the format of parts of a <a href="qtextdocument.html">QTextDocument</a>. The derived classes <a href="qtextcharformat.html">QTextCharFormat</a>, <a href="qtextblockformat.html">QTextBlockFormat</a>, <a href="qtextlistformat.html">QTextListFormat</a>, and <a href="qtexttableformat.html">QTextTableFormat</a> are usually more useful, and describe the formatting that is applied to specific parts of the document.</p>
 
93
<p>A format has a <tt>FormatType</tt> which specifies the kinds of thing it can format; e.g. a block of text, a list, a table, etc. A format also has various properties (some specific to particular format types), as described by the Property enum. Every property has a corresponding Property.</p>
 
94
<p>The format type is given by <a href="qtextformat.html#type">type</a>(), and the format can be tested with <a href="qtextformat.html#isCharFormat">isCharFormat</a>(), <a href="qtextformat.html#isBlockFormat">isBlockFormat</a>(), <a href="qtextformat.html#isListFormat">isListFormat</a>(), <a href="qtextformat.html#isTableFormat">isTableFormat</a>(), <a href="qtextformat.html#isFrameFormat">isFrameFormat</a>(), and <a href="qtextformat.html#isImageFormat">isImageFormat</a>(). If the type is determined, it can be retrieved with <a href="qtextformat.html#toCharFormat">toCharFormat</a>(), <a href="qtextformat.html#toBlockFormat">toBlockFormat</a>(), <a href="qtextformat.html#toListFormat">toListFormat</a>(), <a href="qtextformat.html#toTableFormat">toTableFormat</a>(), <a href="qtextformat.html#toFrameFormat">toFrameFormat</a>(), and <a href="qtextformat.html#toImageFormat">toImageFormat</a>().</p>
 
95
<p>A format's properties can be set with the <a href="qtextformat.html#setProperty">setProperty</a>() functions, and retrieved with <a href="qtextformat.html#boolProperty">boolProperty</a>(), <a href="qtextformat.html#intProperty">intProperty</a>(), <a href="qtextformat.html#doubleProperty">doubleProperty</a>(), and <a href="qtextformat.html#stringProperty">stringProperty</a>() as appropriate. All the property IDs used in the format can be retrieved with allPropertyIds(). One format can be merged into another using <a href="qtextformat.html#merge">merge</a>().</p>
 
96
<p>A format's object index can be set with <a href="qtextformat.html#setObjectIndex">setObjectIndex</a>(), and retrieved with <a href="qtextformat.html#objectIndex">objectIndex</a>(). These methods can be used to associate the format with a <a href="qtextobject.html">QTextObject</a>. It is used to represent lists, frames, and tables inside the document.</p>
 
97
<p>See also <a href="text.html">Text Related Classes</a>.</p>
 
98
<hr />
 
99
<h2>Member Type Documentation</h2>
 
100
<h3 class="fn"><a name="FormatType-enum"></a>enum QTextFormat::FormatType</h3>
 
101
<table border="1" cellpadding="2" cellspacing="1" width="40%">
 
102
<tr><th width="60%">Constant</th><th width="40%">Value</th></tr>
 
103
<tr><td valign="top"><tt>QTextFormat::InvalidFormat</tt></td><td align="center" valign="top"><tt>-1</tt></td></tr>
 
104
<tr><td valign="top"><tt>QTextFormat::BlockFormat</tt></td><td align="center" valign="top"><tt>1</tt></td></tr>
 
105
<tr><td valign="top"><tt>QTextFormat::CharFormat</tt></td><td align="center" valign="top"><tt>2</tt></td></tr>
 
106
<tr><td valign="top"><tt>QTextFormat::ListFormat</tt></td><td align="center" valign="top"><tt>3</tt></td></tr>
 
107
<tr><td valign="top"><tt>QTextFormat::TableFormat</tt></td><td align="center" valign="top"><tt>4</tt></td></tr>
 
108
<tr><td valign="top"><tt>QTextFormat::FrameFormat</tt></td><td align="center" valign="top"><tt>5</tt></td></tr>
 
109
<tr><td valign="top"><tt>QTextFormat::UserFormat</tt></td><td align="center" valign="top"><tt>100</tt></td></tr>
 
110
</table>
 
111
<h3 class="fn"><a name="ObjectTypes-enum"></a>enum QTextFormat::ObjectTypes</h3>
 
112
<table border="1" cellpadding="2" cellspacing="1" width="40%">
 
113
<tr><th width="60%">Constant</th><th width="40%">Value</th></tr>
 
114
<tr><td valign="top"><tt>QTextFormat::NoObject</tt></td><td align="center" valign="top"><tt>0</tt></td></tr>
 
115
<tr><td valign="top"><tt>QTextFormat::ImageObject</tt></td><td align="center" valign="top"><tt>1</tt></td></tr>
 
116
<tr><td valign="top"><tt>QTextFormat::TableObject</tt></td><td align="center" valign="top"><tt>2</tt></td></tr>
 
117
</table>
 
118
<h3 class="fn"><a name="Property-enum"></a>enum QTextFormat::Property</h3>
 
119
<table border="1" cellpadding="2" cellspacing="1" width="40%">
 
120
<tr><th width="60%">Constant</th><th width="40%">Value</th></tr>
 
121
<tr><td valign="top"><tt>QTextFormat::ObjectIndex</tt></td><td align="center" valign="top"><tt>0x0</tt></td></tr>
 
122
</table>
 
123
<p>Paragraph and character properties</p>
 
124
<table border="1" cellpadding="2" cellspacing="1" width="100%">
 
125
<tr><th width="25%">Constant</th><th width="15%">Value</th><th width="60%">Description</th></tr>
 
126
<tr><td valign="top"><tt>QTextFormat::CssFloat</tt></td><td align="center" valign="top"><tt>0x0800</tt></td><td valign="top">&nbsp;</td></tr>
 
127
<tr><td valign="top"><tt>QTextFormat::LayoutDirection</tt></td><td align="center" valign="top"><tt>0x0801</tt></td><td valign="top">The layout direction of the text in the document (<a href="qt.html#LayoutDirection-enum">Qt::LayoutDirection</a>).</td></tr>
 
128
<tr><td valign="top"><tt>QTextFormat::OutlinePen</tt></td><td align="center" valign="top"><tt>0x810</tt></td><td valign="top">&nbsp;</td></tr>
 
129
<tr><td valign="top"><tt>QTextFormat::ForegroundBrush</tt></td><td align="center" valign="top"><tt>0x821</tt></td><td valign="top">&nbsp;</td></tr>
 
130
<tr><td valign="top"><tt>QTextFormat::BackgroundBrush</tt></td><td align="center" valign="top"><tt>0x820</tt></td><td valign="top">&nbsp;</td></tr>
 
131
</table>
 
132
<p>Paragraph properties</p>
 
133
<table border="1" cellpadding="2" cellspacing="1" width="40%">
 
134
<tr><th width="60%">Constant</th><th width="40%">Value</th></tr>
 
135
<tr><td valign="top"><tt>QTextFormat::BlockAlignment</tt></td><td align="center" valign="top"><tt>0x1010</tt></td></tr>
 
136
<tr><td valign="top"><tt>QTextFormat::BlockTopMargin</tt></td><td align="center" valign="top"><tt>0x1030</tt></td></tr>
 
137
<tr><td valign="top"><tt>QTextFormat::BlockBottomMargin</tt></td><td align="center" valign="top"><tt>0x1031</tt></td></tr>
 
138
<tr><td valign="top"><tt>QTextFormat::BlockLeftMargin</tt></td><td align="center" valign="top"><tt>0x1032</tt></td></tr>
 
139
<tr><td valign="top"><tt>QTextFormat::BlockRightMargin</tt></td><td align="center" valign="top"><tt>0x1033</tt></td></tr>
 
140
<tr><td valign="top"><tt>QTextFormat::TextIndent</tt></td><td align="center" valign="top"><tt>0x1034</tt></td></tr>
 
141
<tr><td valign="top"><tt>QTextFormat::BlockIndent</tt></td><td align="center" valign="top"><tt>0x1040</tt></td></tr>
 
142
<tr><td valign="top"><tt>QTextFormat::BlockNonBreakableLines</tt></td><td align="center" valign="top"><tt>0x1050</tt></td></tr>
 
143
</table>
 
144
<p>Character properties</p>
 
145
<table border="1" cellpadding="2" cellspacing="1" width="40%">
 
146
<tr><th width="60%">Constant</th><th width="40%">Value</th></tr>
 
147
<tr><td valign="top"><tt>QTextFormat::FontFamily</tt></td><td align="center" valign="top"><tt>0x2000</tt></td></tr>
 
148
<tr><td valign="top"><tt>QTextFormat::FontPointSize</tt></td><td align="center" valign="top"><tt>0x2001</tt></td></tr>
 
149
<tr><td valign="top"><tt>QTextFormat::FontSizeIncrement</tt></td><td align="center" valign="top"><tt>0x2002</tt></td></tr>
 
150
<tr><td valign="top"><tt>QTextFormat::FontWeight</tt></td><td align="center" valign="top"><tt>0x2003</tt></td></tr>
 
151
<tr><td valign="top"><tt>QTextFormat::FontItalic</tt></td><td align="center" valign="top"><tt>0x2004</tt></td></tr>
 
152
<tr><td valign="top"><tt>QTextFormat::FontUnderline</tt></td><td align="center" valign="top"><tt>0x2005</tt></td></tr>
 
153
<tr><td valign="top"><tt>QTextFormat::FontOverline</tt></td><td align="center" valign="top"><tt>0x2006</tt></td></tr>
 
154
<tr><td valign="top"><tt>QTextFormat::FontStrikeOut</tt></td><td align="center" valign="top"><tt>0x2007</tt></td></tr>
 
155
<tr><td valign="top"><tt>QTextFormat::FontFixedPitch</tt></td><td align="center" valign="top"><tt>0x2008</tt></td></tr>
 
156
<tr><td valign="top"><tt>QTextFormat::TextUnderlineColor</tt></td><td align="center" valign="top"><tt>0x2010</tt></td></tr>
 
157
<tr><td valign="top"><tt>QTextFormat::TextVerticalAlignment</tt></td><td align="center" valign="top"><tt>0x2021</tt></td></tr>
 
158
<tr><td valign="top"><tt>QTextFormat::IsAnchor</tt></td><td align="center" valign="top"><tt>0x2030</tt></td></tr>
 
159
<tr><td valign="top"><tt>QTextFormat::AnchorHref</tt></td><td align="center" valign="top"><tt>0x2031</tt></td></tr>
 
160
<tr><td valign="top"><tt>QTextFormat::AnchorName</tt></td><td align="center" valign="top"><tt>0x2032</tt></td></tr>
 
161
<tr><td valign="top"><tt>QTextFormat::ObjectType</tt></td><td align="center" valign="top"><tt>0x2f00</tt></td></tr>
 
162
</table>
 
163
<p>List properties</p>
 
164
<table border="1" cellpadding="2" cellspacing="1" width="40%">
 
165
<tr><th width="60%">Constant</th><th width="40%">Value</th></tr>
 
166
<tr><td valign="top"><tt>QTextFormat::ListStyle</tt></td><td align="center" valign="top"><tt>0x3000</tt></td></tr>
 
167
<tr><td valign="top"><tt>QTextFormat::ListIndent</tt></td><td align="center" valign="top"><tt>0x3001</tt></td></tr>
 
168
</table>
 
169
<p>Table and frame properties</p>
 
170
<table border="1" cellpadding="2" cellspacing="1" width="40%">
 
171
<tr><th width="60%">Constant</th><th width="40%">Value</th></tr>
 
172
<tr><td valign="top"><tt>QTextFormat::TableColumns</tt></td><td align="center" valign="top"><tt>0x4100</tt></td></tr>
 
173
<tr><td valign="top"><tt>QTextFormat::FrameBorder</tt></td><td align="center" valign="top"><tt>0x4000</tt></td></tr>
 
174
<tr><td valign="top"><tt>QTextFormat::FrameMargin</tt></td><td align="center" valign="top"><tt>0x4001</tt></td></tr>
 
175
<tr><td valign="top"><tt>QTextFormat::FramePadding</tt></td><td align="center" valign="top"><tt>0x4002</tt></td></tr>
 
176
<tr><td valign="top"><tt>QTextFormat::FrameWidth</tt></td><td align="center" valign="top"><tt>0x4003</tt></td></tr>
 
177
<tr><td valign="top"><tt>QTextFormat::FrameHeight</tt></td><td align="center" valign="top"><tt>0x4004</tt></td></tr>
 
178
<tr><td valign="top"><tt>QTextFormat::TableColumnWidthConstraints</tt></td><td align="center" valign="top"><tt>0x4101</tt></td></tr>
 
179
<tr><td valign="top"><tt>QTextFormat::TableCellSpacing</tt></td><td align="center" valign="top"><tt>0x4102</tt></td></tr>
 
180
<tr><td valign="top"><tt>QTextFormat::TableCellPadding</tt></td><td align="center" valign="top"><tt>0x4103</tt></td></tr>
 
181
</table>
 
182
<p>Table cell properties</p>
 
183
<table border="1" cellpadding="2" cellspacing="1" width="40%">
 
184
<tr><th width="60%">Constant</th><th width="40%">Value</th></tr>
 
185
<tr><td valign="top"><tt>QTextFormat::TableCellRowSpan</tt></td><td align="center" valign="top"><tt>0x4810</tt></td></tr>
 
186
<tr><td valign="top"><tt>QTextFormat::TableCellColumnSpan</tt></td><td align="center" valign="top"><tt>0x4811</tt></td></tr>
 
187
</table>
 
188
<p>Image properties</p>
 
189
<table border="1" cellpadding="2" cellspacing="1" width="40%">
 
190
<tr><th width="60%">Constant</th><th width="40%">Value</th></tr>
 
191
<tr><td valign="top"><tt>QTextFormat::ImageName</tt></td><td align="center" valign="top"><tt>0x5000</tt></td></tr>
 
192
<tr><td valign="top"><tt>QTextFormat::ImageWidth</tt></td><td align="center" valign="top"><tt>0x5010</tt></td></tr>
 
193
<tr><td valign="top"><tt>QTextFormat::ImageHeight</tt></td><td align="center" valign="top"><tt>0x5011</tt></td></tr>
 
194
<tr><td valign="top"><tt>QTextFormat::UserProperty</tt></td><td align="center" valign="top"><tt>0x100000</tt></td></tr>
 
195
</table>
 
196
<hr />
 
197
<h2>Member Function Documentation</h2>
 
198
<h3 class="fn"><a name="QTextFormat"></a>QTextFormat::QTextFormat ()</h3>
 
199
<p>Creates a new text format with an <tt>InvalidFormat</tt>.</p>
 
200
<p>See also <a href="qtextformat.html#FormatType-enum">FormatType</a>.</p>
 
201
<h3 class="fn"><a name="QTextFormat-2"></a>QTextFormat::QTextFormat ( int <i>type</i> )</h3>
 
202
<p>Creates a new text format of the given <i>type</i>.</p>
 
203
<p>See also <a href="qtextformat.html#FormatType-enum">FormatType</a>.</p>
 
204
<h3 class="fn"><a name="QTextFormat-3"></a>QTextFormat::QTextFormat ( const QTextFormat &amp; <i>other</i> )</h3>
 
205
<p>Creates a new text format with the same attributes at the <i>other</i> text format.</p>
 
206
<h3 class="fn"><a name="dtor.QTextFormat"></a>QTextFormat::~QTextFormat ()</h3>
 
207
<p>Destroys this text format.</p>
 
208
<h3 class="fn"><a name="background"></a><a href="qbrush.html">QBrush</a> QTextFormat::background () const</h3>
 
209
<p>Returns the brush used to paint the document's background.</p>
 
210
<p>See also <a href="qtextformat.html#setBackground">setBackground</a>(), <a href="qtextformat.html#clearBackground">clearBackground</a>(), and <a href="qtextformat.html#foreground">foreground</a>().</p>
 
211
<h3 class="fn"><a name="boolProperty"></a>bool QTextFormat::boolProperty ( int <i>propertyId</i> ) const</h3>
 
212
<p>Returns the value of the property specified by <i>propertyId</i>. If the property isn't of <tt>QTextFormat::Bool</tt> type, false is returned instead.</p>
 
213
<p>See also <a href="qtextformat.html#setProperty">setProperty</a>(), <a href="qtextformat.html#intProperty">intProperty</a>(), <a href="qtextformat.html#doubleProperty">doubleProperty</a>(), <a href="qtextformat.html#stringProperty">stringProperty</a>(), <a href="qtextformat.html#colorProperty">colorProperty</a>(), <a href="qtextformat.html#lengthProperty">lengthProperty</a>(), <a href="qtextformat.html#lengthVectorProperty">lengthVectorProperty</a>(), and <a href="qtextformat.html#Property-enum">Property</a>.</p>
 
214
<h3 class="fn"><a name="brushProperty"></a><a href="qbrush.html">QBrush</a> QTextFormat::brushProperty ( int <i>propertyId</i> ) const</h3>
 
215
<p>Returns the value of the property given by <i>propertyId</i>; if the property isn't of <tt>QVariant::Brush</tt> type, <a href="qt.html#BrushStyle-enum">Qt::NoBrush</a> is returned instead.</p>
 
216
<p>See also <a href="qtextformat.html#setProperty">setProperty</a>(), <a href="qtextformat.html#boolProperty">boolProperty</a>(), <a href="qtextformat.html#intProperty">intProperty</a>(), <a href="qtextformat.html#doubleProperty">doubleProperty</a>(), <a href="qtextformat.html#stringProperty">stringProperty</a>(), <a href="qtextformat.html#lengthProperty">lengthProperty</a>(), <a href="qtextformat.html#lengthVectorProperty">lengthVectorProperty</a>(), and <a href="qtextformat.html#Property-enum">Property</a>.</p>
 
217
<h3 class="fn"><a name="clearBackground"></a>void QTextFormat::clearBackground ()</h3>
 
218
<p>Clears the brush used to paint the document's background. The default brush will be used.</p>
 
219
<p>See also <a href="qtextformat.html#background">background</a>(), <a href="qtextformat.html#setBackground">setBackground</a>(), and <a href="qtextformat.html#clearForeground">clearForeground</a>().</p>
 
220
<h3 class="fn"><a name="clearForeground"></a>void QTextFormat::clearForeground ()</h3>
 
221
<p>Clears the brush used to paint the document's foreground. The default brush will be used.</p>
 
222
<p>See also <a href="qtextformat.html#foreground">foreground</a>(), <a href="qtextformat.html#setForeground">setForeground</a>(), and <a href="qtextformat.html#clearBackground">clearBackground</a>().</p>
 
223
<h3 class="fn"><a name="clearProperty"></a>void QTextFormat::clearProperty ( int <i>propertyId</i> )</h3>
 
224
<p>Clears the value of the property given by <i>propertyId</i></p>
 
225
<h3 class="fn"><a name="colorProperty"></a><a href="qcolor.html">QColor</a> QTextFormat::colorProperty ( int <i>propertyId</i> ) const</h3>
 
226
<p>Returns the value of the property given by <i>propertyId</i>; if the property isn't of <tt>QVariant::Color</tt> type, an invalid color is returned instead.</p>
 
227
<p>See also <a href="qtextformat.html#setProperty">setProperty</a>(), <a href="qtextformat.html#boolProperty">boolProperty</a>(), <a href="qtextformat.html#intProperty">intProperty</a>(), <a href="qtextformat.html#doubleProperty">doubleProperty</a>(), <a href="qtextformat.html#stringProperty">stringProperty</a>(), <a href="qtextformat.html#lengthProperty">lengthProperty</a>(), <a href="qtextformat.html#lengthVectorProperty">lengthVectorProperty</a>(), and <a href="qtextformat.html#Property-enum">Property</a>.</p>
 
228
<h3 class="fn"><a name="doubleProperty"></a><a href="qtglobal.html#qreal-typedef">qreal</a> QTextFormat::doubleProperty ( int <i>propertyId</i> ) const</h3>
 
229
<p>Returns the value of the property specified by <i>propertyId</i>. If the property isn't of <tt>QVariant::Double</tt> type, 0 is returned instead.</p>
 
230
<p>See also <a href="qtextformat.html#setProperty">setProperty</a>(), <a href="qtextformat.html#boolProperty">boolProperty</a>(), <a href="qtextformat.html#intProperty">intProperty</a>(), <a href="qtextformat.html#stringProperty">stringProperty</a>(), <a href="qtextformat.html#colorProperty">colorProperty</a>(), <a href="qtextformat.html#lengthProperty">lengthProperty</a>(), <a href="qtextformat.html#lengthVectorProperty">lengthVectorProperty</a>(), and <a href="qtextformat.html#Property-enum">Property</a>.</p>
 
231
<h3 class="fn"><a name="foreground"></a><a href="qbrush.html">QBrush</a> QTextFormat::foreground () const</h3>
 
232
<p>Returns the brush used to render foreground details, such as text, frame outlines, and table borders.</p>
 
233
<p>See also <a href="qtextformat.html#setForeground">setForeground</a>(), <a href="qtextformat.html#clearForeground">clearForeground</a>(), and <a href="qtextformat.html#background">background</a>().</p>
 
234
<h3 class="fn"><a name="hasProperty"></a>bool QTextFormat::hasProperty ( int <i>propertyId</i> ) const</h3>
 
235
<p>Returns true if the text format has a property with the given <i>propertyId</i>; otherwise returns false.</p>
 
236
<p>See also <a href="qtextformat.html#properties">properties</a>() and <a href="qtextformat.html#Property-enum">Property</a>.</p>
 
237
<h3 class="fn"><a name="intProperty"></a>int QTextFormat::intProperty ( int <i>propertyId</i> ) const</h3>
 
238
<p>Returns the value of the property specified by <i>propertyId</i>. If the property is not of <tt>QTextFormat::Integer</tt> type, 0 is returned instead.</p>
 
239
<p>See also <a href="qtextformat.html#setProperty">setProperty</a>(), <a href="qtextformat.html#boolProperty">boolProperty</a>(), <a href="qtextformat.html#doubleProperty">doubleProperty</a>(), <a href="qtextformat.html#stringProperty">stringProperty</a>(), <a href="qtextformat.html#colorProperty">colorProperty</a>(), <a href="qtextformat.html#lengthProperty">lengthProperty</a>(), <a href="qtextformat.html#lengthVectorProperty">lengthVectorProperty</a>(), and <a href="qtextformat.html#Property-enum">Property</a>.</p>
 
240
<h3 class="fn"><a name="isBlockFormat"></a>bool QTextFormat::isBlockFormat () const</h3>
 
241
<p>Returns true if this text format is a <tt>BlockFormat</tt>; otherwise returns false.</p>
 
242
<h3 class="fn"><a name="isCharFormat"></a>bool QTextFormat::isCharFormat () const</h3>
 
243
<p>Returns true if this text format is a <tt>CharFormat</tt>; otherwise returns false.</p>
 
244
<h3 class="fn"><a name="isFrameFormat"></a>bool QTextFormat::isFrameFormat () const</h3>
 
245
<p>Returns true if this text format is a <tt>FrameFormat</tt>; otherwise returns false.</p>
 
246
<h3 class="fn"><a name="isImageFormat"></a>bool QTextFormat::isImageFormat () const</h3>
 
247
<p>Returns true if this text format is an image format; otherwise returns false.</p>
 
248
<h3 class="fn"><a name="isListFormat"></a>bool QTextFormat::isListFormat () const</h3>
 
249
<p>Returns true if this text format is a <tt>ListFormat</tt>; otherwise returns false.</p>
 
250
<h3 class="fn"><a name="isTableFormat"></a>bool QTextFormat::isTableFormat () const</h3>
 
251
<p>Returns true if this text format is a <tt>TableFormat</tt>; otherwise returns false.</p>
 
252
<h3 class="fn"><a name="isValid"></a>bool QTextFormat::isValid () const</h3>
 
253
<p>Returns true if the format is valid (i.e. is not <tt>InvalidFormat</tt>); otherwise returns false.</p>
 
254
<h3 class="fn"><a name="layoutDirection"></a><a href="qt.html#LayoutDirection-enum">Qt::LayoutDirection</a> QTextFormat::layoutDirection () const</h3>
 
255
<p>Returns the document's layout direction.</p>
 
256
<p>See also <a href="qtextformat.html#setLayoutDirection">setLayoutDirection</a>().</p>
 
257
<h3 class="fn"><a name="lengthProperty"></a><a href="qtextlength.html">QTextLength</a> QTextFormat::lengthProperty ( int <i>propertyId</i> ) const</h3>
 
258
<p>Returns the value of the property given by <i>propertyId</i>.</p>
 
259
<p>See also <a href="qtextformat.html#setProperty">setProperty</a>(), <a href="qtextformat.html#boolProperty">boolProperty</a>(), <a href="qtextformat.html#intProperty">intProperty</a>(), <a href="qtextformat.html#doubleProperty">doubleProperty</a>(), <a href="qtextformat.html#stringProperty">stringProperty</a>(), <a href="qtextformat.html#colorProperty">colorProperty</a>(), <a href="qtextformat.html#lengthVectorProperty">lengthVectorProperty</a>(), and <a href="qtextformat.html#Property-enum">Property</a>.</p>
 
260
<h3 class="fn"><a name="lengthVectorProperty"></a><a href="qvector.html">QVector</a>&lt;<a href="qtextlength.html">QTextLength</a>&gt; QTextFormat::lengthVectorProperty ( int <i>propertyId</i> ) const</h3>
 
261
<p>Returns the value of the property given by <i>propertyId</i>. If the property isn't of <tt>QTextFormat::LengthVector</tt> type, an empty length vector is returned instead.</p>
 
262
<p>See also <a href="qtextformat.html#setProperty">setProperty</a>(), <a href="qtextformat.html#boolProperty">boolProperty</a>(), <a href="qtextformat.html#intProperty">intProperty</a>(), <a href="qtextformat.html#doubleProperty">doubleProperty</a>(), <a href="qtextformat.html#stringProperty">stringProperty</a>(), <a href="qtextformat.html#colorProperty">colorProperty</a>(), <a href="qtextformat.html#lengthProperty">lengthProperty</a>(), and <a href="qtextformat.html#Property-enum">Property</a>.</p>
 
263
<h3 class="fn"><a name="merge"></a>void QTextFormat::merge ( const QTextFormat &amp; <i>other</i> )</h3>
 
264
<p>Merges the <i>other</i> format with this format; where there are conflicts the <i>other</i> format takes precedence.</p>
 
265
<h3 class="fn"><a name="objectIndex"></a>int QTextFormat::objectIndex () const</h3>
 
266
<p>Returns the index of the format object, or -1 if the format object is invalid.</p>
 
267
<p>See also <a href="qtextformat.html#setObjectIndex">setObjectIndex</a>().</p>
 
268
<h3 class="fn"><a name="objectType"></a>int QTextFormat::objectType () const</h3>
 
269
<p>Returns the text format's object type. See <tt>ObjectTypes</tt>.</p>
 
270
<h3 class="fn"><a name="penProperty"></a><a href="qpen.html">QPen</a> QTextFormat::penProperty ( int <i>propertyId</i> ) const</h3>
 
271
<p>Returns the value of the property given by <i>propertyId</i>; if the property isn't of <tt>QVariant::Pen</tt> type, <a href="qt.html#PenStyle-enum">Qt::NoPen</a> is returned instead.</p>
 
272
<p>See also <a href="qtextformat.html#setProperty">setProperty</a>(), <a href="qtextformat.html#boolProperty">boolProperty</a>(), <a href="qtextformat.html#intProperty">intProperty</a>(), <a href="qtextformat.html#doubleProperty">doubleProperty</a>(), <a href="qtextformat.html#stringProperty">stringProperty</a>(), <a href="qtextformat.html#lengthProperty">lengthProperty</a>(), <a href="qtextformat.html#lengthVectorProperty">lengthVectorProperty</a>(), and <a href="qtextformat.html#Property-enum">Property</a>.</p>
 
273
<h3 class="fn"><a name="properties"></a><a href="qmap.html">QMap</a>&lt;int, <a href="qvariant.html">QVariant</a>&gt; QTextFormat::properties () const</h3>
 
274
<p>Returns a map with all properties of this text format.</p>
 
275
<h3 class="fn"><a name="property"></a><a href="qvariant.html">QVariant</a> QTextFormat::property ( int <i>propertyId</i> ) const</h3>
 
276
<p>Returns the property specified by the given <i>propertyId</i>.</p>
 
277
<h3 class="fn"><a name="setBackground"></a>void QTextFormat::setBackground ( const <a href="qbrush.html">QBrush</a> &amp; <i>brush</i> )</h3>
 
278
<p>Sets the brush use to paint the document's background to the <i>brush</i> specified.</p>
 
279
<p>See also <a href="qtextformat.html#background">background</a>(), <a href="qtextformat.html#clearBackground">clearBackground</a>(), and <a href="qtextformat.html#setForeground">setForeground</a>().</p>
 
280
<h3 class="fn"><a name="setForeground"></a>void QTextFormat::setForeground ( const <a href="qbrush.html">QBrush</a> &amp; <i>brush</i> )</h3>
 
281
<p>Sets the foreground brush to the specified <i>brush</i>. The foreground brush is mostly used to render text.</p>
 
282
<p>See also <a href="qtextformat.html#foreground">foreground</a>(), <a href="qtextformat.html#clearForeground">clearForeground</a>(), and <a href="qtextformat.html#setBackground">setBackground</a>().</p>
 
283
<h3 class="fn"><a name="setLayoutDirection"></a>void QTextFormat::setLayoutDirection ( <a href="qt.html#LayoutDirection-enum">Qt::LayoutDirection</a> <i>direction</i> )</h3>
 
284
<p>Sets the document's layout direction to the specified <i>direction</i>.</p>
 
285
<p>See also <a href="qtextformat.html#layoutDirection">layoutDirection</a>().</p>
 
286
<h3 class="fn"><a name="setObjectIndex"></a>void QTextFormat::setObjectIndex ( int <i>index</i> )</h3>
 
287
<p>Sets the format object's object <i>index</i>.</p>
 
288
<p>See also <a href="qtextformat.html#objectIndex">objectIndex</a>().</p>
 
289
<h3 class="fn"><a name="setObjectType"></a>void QTextFormat::setObjectType ( int <i>type</i> )</h3>
 
290
<p>Sets the text format's object <i>type</i>. See <tt>ObjectTypes</tt>.</p>
 
291
<h3 class="fn"><a name="setProperty"></a>void QTextFormat::setProperty ( int <i>propertyId</i>, const <a href="qvariant.html">QVariant</a> &amp; <i>value</i> )</h3>
 
292
<p>Sets the property specified by the <i>propertyId</i> to the given <i>value</i>.</p>
 
293
<h3 class="fn"><a name="setProperty-2"></a>void QTextFormat::setProperty ( int <i>propertyId</i>, const <a href="qvector.html">QVector</a>&lt;<a href="qtextlength.html">QTextLength</a>&gt; &amp; <i>value</i> )</h3>
 
294
<p>This is an overloaded member function, provided for convenience. It behaves essentially like the above function.</p>
 
295
<p>Sets the value of the property given by <i>propertyId</i> to <i>value</i>.</p>
 
296
<p>See also <a href="qtextformat.html#lengthVectorProperty">lengthVectorProperty</a>() and <a href="qtextformat.html#Property-enum">Property</a>.</p>
 
297
<h3 class="fn"><a name="stringProperty"></a><a href="qstring.html">QString</a> QTextFormat::stringProperty ( int <i>propertyId</i> ) const</h3>
 
298
<p>Returns the value of the property given by <i>propertyId</i>; if the property isn't of <tt>QVariant::String</tt> type, an empty string is returned instead.</p>
 
299
<p>See also <a href="qtextformat.html#setProperty">setProperty</a>(), <a href="qtextformat.html#boolProperty">boolProperty</a>(), <a href="qtextformat.html#intProperty">intProperty</a>(), <a href="qtextformat.html#doubleProperty">doubleProperty</a>(), <a href="qtextformat.html#colorProperty">colorProperty</a>(), <a href="qtextformat.html#lengthProperty">lengthProperty</a>(), <a href="qtextformat.html#lengthVectorProperty">lengthVectorProperty</a>(), and <a href="qtextformat.html#Property-enum">Property</a>.</p>
 
300
<h3 class="fn"><a name="toBlockFormat"></a><a href="qtextblockformat.html">QTextBlockFormat</a> QTextFormat::toBlockFormat () const</h3>
 
301
<p>Returns this format as a block format.</p>
 
302
<h3 class="fn"><a name="toCharFormat"></a><a href="qtextcharformat.html">QTextCharFormat</a> QTextFormat::toCharFormat () const</h3>
 
303
<p>Returns this format as a character format.</p>
 
304
<h3 class="fn"><a name="toFrameFormat"></a><a href="qtextframeformat.html">QTextFrameFormat</a> QTextFormat::toFrameFormat () const</h3>
 
305
<p>Returns this format as a frame format.</p>
 
306
<h3 class="fn"><a name="toImageFormat"></a><a href="qtextimageformat.html">QTextImageFormat</a> QTextFormat::toImageFormat () const</h3>
 
307
<p>Returns this format as an image format.</p>
 
308
<h3 class="fn"><a name="toListFormat"></a><a href="qtextlistformat.html">QTextListFormat</a> QTextFormat::toListFormat () const</h3>
 
309
<p>Returns this format as a list format.</p>
 
310
<h3 class="fn"><a name="toTableFormat"></a><a href="qtexttableformat.html">QTextTableFormat</a> QTextFormat::toTableFormat () const</h3>
 
311
<p>Returns this format as a table format.</p>
 
312
<h3 class="fn"><a name="type"></a>int QTextFormat::type () const</h3>
 
313
<p>Returns the type of this format.</p>
 
314
<p>See also <a href="qtextformat.html#ObjectTypes-enum">ObjectTypes</a>.</p>
 
315
<h3 class="fn"><a name="operator-QVariant"></a>QTextFormat::operator QVariant () const</h3>
 
316
<p>Returns the text format as a <a href="qvariant.html">QVariant</a></p>
 
317
<h3 class="fn"><a name="operator-not-eq"></a>bool QTextFormat::operator!= ( const QTextFormat &amp; <i>other</i> ) const</h3>
 
318
<p>Returns true if this text format is different from the <i>other</i> text format.</p>
 
319
<h3 class="fn"><a name="operator-eq"></a>QTextFormat &amp; QTextFormat::operator= ( const QTextFormat &amp; <i>other</i> )</h3>
 
320
<p>Assigns the <i>other</i> text format to this text format, and returns a reference to this text format.</p>
 
321
<h3 class="fn"><a name="operator-eq-eq"></a>bool QTextFormat::operator== ( const QTextFormat &amp; <i>other</i> ) const</h3>
 
322
<p>Returns true if this text format is the same as the <i>other</i> text format.</p>
 
323
<p /><address><hr /><div align="center">
 
324
<table width="100%" cellspacing="0" border="0"><tr class="address">
 
325
<td width="30%">Copyright &copy; 2005 <a href="trolltech.html">Trolltech</a></td>
 
326
<td width="40%" align="center"><a href="trademarks.html">Trademarks</a></td>
 
327
<td width="30%" align="right"><div align="right">Qt 4.0.0</div></td>
 
328
</tr></table></div></address></body>
 
329
</html>