source: trunk/doc/html/qstylesheet.html@ 203

Last change on this file since 203 was 190, checked in by rudi, 14 years ago

reference documentation added

File size: 23.2 KB
Line 
1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
2<!-- /home/espenr/tmp/qt-3.3.8-espenr-2499/qt-x11-free-3.3.8/src/kernel/qstylesheet.cpp:854 -->
3<html>
4<head>
5<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
6<title>QStyleSheet Class</title>
7<style type="text/css"><!--
8fn { margin-left: 1cm; text-indent: -1cm; }
9a:link { color: #004faf; text-decoration: none }
10a:visited { color: #672967; text-decoration: none }
11body { background: #ffffff; color: black; }
12--></style>
13</head>
14<body>
15
16<table border="0" cellpadding="0" cellspacing="0" width="100%">
17<tr bgcolor="#E5E5E5">
18<td valign=center>
19 <a href="index.html">
20<font color="#004faf">Home</font></a>
21 | <a href="classes.html">
22<font color="#004faf">All&nbsp;Classes</font></a>
23 | <a href="mainclasses.html">
24<font color="#004faf">Main&nbsp;Classes</font></a>
25 | <a href="annotated.html">
26<font color="#004faf">Annotated</font></a>
27 | <a href="groups.html">
28<font color="#004faf">Grouped&nbsp;Classes</font></a>
29 | <a href="functions.html">
30<font color="#004faf">Functions</font></a>
31</td>
32<td align="right" valign="center"><img src="logo32.png" align="right" width="64" height="32" border="0"></td></tr></table><h1 align=center>QStyleSheet Class Reference</h1>
33
34<p>The QStyleSheet class is a collection of styles for rich text
35rendering and a generator of tags.
36<a href="#details">More...</a>
37<p><tt>#include &lt;<a href="qstylesheet-h.html">qstylesheet.h</a>&gt;</tt>
38<p>Inherits <a href="qobject.html">QObject</a>.
39<p><a href="qstylesheet-members.html">List of all member functions.</a>
40<h2>Public Members</h2>
41<ul>
42<li class=fn><a href="#QStyleSheet"><b>QStyleSheet</b></a> ( QObject&nbsp;*&nbsp;parent = 0, const&nbsp;char&nbsp;*&nbsp;name = 0 )</li>
43<li class=fn>virtual <a href="#~QStyleSheet"><b>~QStyleSheet</b></a> ()</li>
44<li class=fn>QStyleSheetItem * <a href="#item"><b>item</b></a> ( const&nbsp;QString&nbsp;&amp;&nbsp;name )</li>
45<li class=fn>const QStyleSheetItem * <a href="#item-2"><b>item</b></a> ( const&nbsp;QString&nbsp;&amp;&nbsp;name ) const</li>
46<li class=fn>virtual QTextCustomItem * <a href="#tag"><b>tag</b></a> ( const&nbsp;QString&nbsp;&amp;&nbsp;name, const&nbsp;QMap&lt;QString,&nbsp;QString&gt;&nbsp;&amp;&nbsp;attr, const&nbsp;QString&nbsp;&amp;&nbsp;context, const&nbsp;QMimeSourceFactory&nbsp;&amp;&nbsp;factory, bool&nbsp;emptyTag, QTextDocument&nbsp;*&nbsp;doc ) const</li>
47<li class=fn>virtual void <a href="#scaleFont"><b>scaleFont</b></a> ( QFont&nbsp;&amp;&nbsp;font, int&nbsp;logicalSize ) const</li>
48<li class=fn>virtual void <a href="#error"><b>error</b></a> ( const&nbsp;QString&nbsp;&amp;&nbsp;msg ) const</li>
49</ul>
50<h2>Static Public Members</h2>
51<ul>
52<li class=fn>QStyleSheet * <a href="#defaultSheet"><b>defaultSheet</b></a> ()</li>
53<li class=fn>void <a href="#setDefaultSheet"><b>setDefaultSheet</b></a> ( QStyleSheet&nbsp;*&nbsp;sheet )</li>
54<li class=fn>QString <a href="#escape"><b>escape</b></a> ( const&nbsp;QString&nbsp;&amp;&nbsp;plain )</li>
55<li class=fn>QString <a href="#convertFromPlainText"><b>convertFromPlainText</b></a> ( const&nbsp;QString&nbsp;&amp;&nbsp;plain, QStyleSheetItem::WhiteSpaceMode&nbsp;mode = QStyleSheetItem::WhiteSpacePre )</li>
56<li class=fn>bool <a href="#mightBeRichText"><b>mightBeRichText</b></a> ( const&nbsp;QString&nbsp;&amp;&nbsp;text )</li>
57</ul>
58<hr><a name="details"></a><h2>Detailed Description</h2>
59
60
61
62The QStyleSheet class is a collection of styles for rich text
63rendering and a generator of tags.
64<p>
65
66<p> By creating <a href="qstylesheetitem.html">QStyleSheetItem</a> objects for a style sheet you build a
67definition of a set of tags. This definition will be used by the
68internal rich text rendering system to parse and display text
69documents to which the style sheet applies. Rich text is normally
70visualized in a <a href="qtextedit.html">QTextEdit</a> or a <a href="qtextbrowser.html">QTextBrowser</a>. However, <a href="qlabel.html">QLabel</a>,
71<a href="qwhatsthis.html">QWhatsThis</a> and <a href="qmessagebox.html">QMessageBox</a> also support it, and other classes are
72likely to follow. With <a href="qsimplerichtext.html">QSimpleRichText</a> it is possible to use the
73rich text renderer for custom widgets as well.
74<p> The default QStyleSheet object has the following style bindings,
75sorted by structuring bindings, anchors, character style bindings
76(i.e. inline styles), special elements such as horizontal lines or
77images, and other tags. In addition, rich text supports simple
78HTML tables.
79<p> The structuring tags are
80<center><table cellpadding="4" cellspacing="2" border="0">
81<tr bgcolor="#a2c511"> <th valign="top">Structuring tags <th valign="top">Notes
82<tr bgcolor="#f0f0f0"> <td valign="top"><tt>&lt;qt&gt;</tt>...<tt>&lt;/qt&gt;</tt>
83<td valign="top">A Qt rich text document. It understands the following
84attributes:
85<ul>
86<li> <tt>title</tt> -- The caption of the document. This attribute is
87easily accessible with <a href="qtextedit.html#documentTitle">QTextEdit::documentTitle</a>().
88<li> <tt>type</tt> -- The type of the document. The default type is <tt>page</tt>. It indicates that the document is displayed in a
89page of its own. Another style is <tt>detail</tt>, which can be
90used to explain certain expressions in more detail in a
91few sentences. For <tt>detail</tt>, <a href="qtextbrowser.html">QTextBrowser</a> will then keep
92the current page and display the new document in a small
93popup similar to <a href="qwhatsthis.html">QWhatsThis</a>. Note that links will not work
94in documents with <tt>&lt;qt type="detail"&gt;...&lt;/qt&gt;</tt>.
95<li> <tt>bgcolor</tt> -- The background color, for example <tt>bgcolor="yellow"</tt> or <tt>bgcolor="#0000FF"</tt>.
96<li> <tt>background</tt> -- The background pixmap, for example <tt>background="granite.xpm"</tt>. The pixmap name will be resolved
97by a <a href="qmimesourcefactory.html">QMimeSourceFactory</a>().
98<li> <tt>text</tt> -- The default text color, for example <tt>text="red"</tt>.
99<li> <tt>link</tt> -- The link color, for example <tt>link="green"</tt>.
100</ul>
101<tr bgcolor="#d0d0d0"> <td valign="top"><tt>&lt;h1&gt;...&lt;/h1&gt;</tt>
102<td valign="top">A top-level heading.
103<tr bgcolor="#f0f0f0"> <td valign="top"><tt>&lt;h2&gt;...&lt;/h2&gt;</tt>
104<td valign="top">A sublevel heading.
105<tr bgcolor="#d0d0d0"> <td valign="top"><tt>&lt;h3&gt;...&lt;/h3&gt;</tt>
106<td valign="top">A sub-sublevel heading.
107<tr bgcolor="#f0f0f0"> <td valign="top"><tt>&lt;h4&gt;...&lt;/h4&gt;</tt> <tt>&lt;h5&gt;...&lt;/h5&gt;</tt>
108<td valign="top">Headings of lesser importance.
109<tr bgcolor="#d0d0d0"> <td valign="top"><tt>&lt;p&gt;...&lt;/p&gt;</tt>
110<td valign="top">A left-aligned paragraph. Adjust the alignment with the <tt>align</tt> attribute. Possible values are <tt>left</tt>, <tt>right</tt> and
111<tt>center</tt>.
112<tr bgcolor="#f0f0f0"> <td valign="top"><tt>&lt;center&gt;...</tt><br><tt>&lt;/center&gt;</tt>
113<td valign="top">A centered paragraph.
114<tr bgcolor="#d0d0d0"> <td valign="top"><tt>&lt;blockquote&gt;...</tt><br><tt>&lt;/blockquote&gt;</tt>
115<td valign="top">An indented paragraph that is useful for quotes.
116<tr bgcolor="#f0f0f0"> <td valign="top"><tt>&lt;ul&gt;...&lt;/ul&gt;</tt>
117<td valign="top">An unordered list. You can also pass a type argument to
118define the bullet style. The default is <tt>type=disc</tt>;
119other types are <tt>circle</tt> and <tt>square</tt>.
120<tr bgcolor="#d0d0d0"> <td valign="top"><tt>&lt;ol&gt;...&lt;/ol&gt;</tt>
121<td valign="top">An ordered list. You can also pass a type argument to
122define the enumeration label style. The default is <tt>type="1"</tt>; other types are <tt>"a"</tt> and <tt>"A"</tt>.
123<tr bgcolor="#f0f0f0"> <td valign="top"><tt>&lt;li&gt;...&lt;/li&gt;</tt>
124<td valign="top">A list item. This tag can be used only within the context
125of <tt>&lt;ol&gt;</tt> or <tt>&lt;ul&gt;</tt>.
126<tr bgcolor="#d0d0d0"> <td valign="top"><tt>&lt;dl&gt;...&lt;/dl&gt;</tt>
127<td valign="top">A list of definitions, consisting of terms and descriptions.
128<tr bgcolor="#f0f0f0"> <td valign="top"><tt>&lt;dt&gt;...&lt;/dt&gt;</tt>
129<td valign="top">A term in a list of definitions. This tag can be used only
130in the context of <tt>&lt;dl&gt;...&lt;/dl&gt;</tt>.
131<tr bgcolor="#d0d0d0"> <td valign="top"><tt>&lt;dd&gt;...&lt;/dd&gt;</tt>
132<td valign="top">A description in a list of definitions. This tag can be
133used only in the context of <tt>&lt;dl&gt;...&lt;/dl&gt;</tt>.
134<tr bgcolor="#f0f0f0"> <td valign="top"><tt>&lt;pre&gt;...&lt;/pre&gt;</tt>
135<td valign="top">For larger chunks of code. Whitespaces in the contents are
136preserved. For small bits of code use the inline-style <tt>code</tt>.
137<tr bgcolor="#d0d0d0"> <td valign="top"><tt>&lt;div&gt;...&lt;/div&gt;</tt> and <tt>&lt;span&gt;...&lt;/span&gt;</tt>
138<td valign="top">Block grouping elements. These are used to structure the
139document, and are often used to provide hints about the
140intended presentation of the document.
141</table></center>
142<p> Anchors and links are done with a single tag:
143<center><table cellpadding="4" cellspacing="2" border="0">
144<tr bgcolor="#a2c511"> <th valign="top">Anchor tags <th valign="top">Notes
145<tr bgcolor="#f0f0f0"> <td valign="top"><tt>&lt;a&gt;...&lt;/a&gt;</tt>
146<td valign="top">An anchor or link.
147<ul>
148<li> A link is created by using an <tt>href</tt>
149attribute, for example
150<br><tt>&lt;a href="target.qml"&gt;Link Text&lt;/a&gt;</tt>. Links to
151targets within a document are achieved in the same way
152as for HTML, e.g.
153<br><tt>&lt;a href="target.qml#subtitle"&gt;Link Text&lt;/a&gt;</tt>.
154<li> A target is created by using a <a href="qobject.html#name-prop">name</a>
155attribute, for example
156<br><tt>&lt;a name="subtitle"&gt;&lt;h2&gt;Sub Title&lt;/h2&gt;&lt;/a&gt;</tt>.
157</ul>
158</table></center>
159<p> The default character style bindings are
160<center><table cellpadding="4" cellspacing="2" border="0">
161<tr bgcolor="#a2c511"> <th valign="top">Style tags <th valign="top">Notes
162<tr bgcolor="#d0d0d0"> <td valign="top"><tt>&lt;em&gt;...&lt;/em&gt;</tt>
163<td valign="top">Emphasized. By default this is the same as <tt>&lt;i&gt;...&lt;/i&gt;</tt>
164(italic).
165<tr bgcolor="#f0f0f0"> <td valign="top"><tt>&lt;strong&gt;...&lt;/strong&gt;</tt>
166<td valign="top">Strong. By default this is the same as <tt>&lt;b&gt;...&lt;/b&gt;</tt>
167(bold).
168<tr bgcolor="#d0d0d0"> <td valign="top"><tt>&lt;i&gt;...&lt;/i&gt;</tt>
169<td valign="top">Italic font style.
170<tr bgcolor="#f0f0f0"> <td valign="top"><tt>&lt;b&gt;...&lt;/b&gt;</tt>
171<td valign="top">Bold font style.
172<tr bgcolor="#d0d0d0"> <td valign="top"><tt>&lt;u&gt;...&lt;/u&gt;</tt>
173<td valign="top">Underlined font style.
174<tr bgcolor="#f0f0f0"> <td valign="top"><tt>&lt;s&gt;...&lt;/s&gt;</tt>
175<td valign="top">Strike out font style.
176<tr bgcolor="#d0d0d0"> <td valign="top"><tt>&lt;big&gt;...&lt;/big&gt;</tt>
177<td valign="top">A larger font size.
178<tr bgcolor="#f0f0f0"> <td valign="top"><tt>&lt;small&gt;...&lt;/small&gt;</tt>
179<td valign="top">A smaller font size.
180<tr bgcolor="#d0d0d0"> <td valign="top"><tt>&lt;sub&gt;...&lt;/sub&gt;</tt>
181<td valign="top">Subscripted text
182<tr bgcolor="#f0f0f0"> <td valign="top"><tt>&lt;sup&gt;...&lt;/sup&gt;</tt>
183<td valign="top">Superscripted text
184<tr bgcolor="#d0d0d0"> <td valign="top"><tt>&lt;code&gt;...&lt;/code&gt;</tt>
185<td valign="top">Indicates code. By default this is the same as
186<tt>&lt;tt&gt;...&lt;/tt&gt;</tt> (typewriter). For larger chunks of code
187use the block-tag <tt>&lt;</tt><tt>pre&gt;</tt>.
188<tr bgcolor="#f0f0f0"> <td valign="top"><tt>&lt;tt&gt;...&lt;/tt&gt;</tt>
189<td valign="top">Typewriter font style.
190<tr bgcolor="#d0d0d0"> <td valign="top"><tt>&lt;font&gt;...&lt;/font&gt;</tt>
191<td valign="top">Customizes the font size, family and text color. The tag
192understands the following attributes:
193<ul>
194<li> <tt>color</tt> -- The text color, for example <tt>color="red"</tt> or
195<tt>color="#FF0000"</tt>.
196<li> <tt>size</tt> -- The logical size of the font. Logical sizes 1
197to 7 are supported. The value may either be absolute
198(for example, <tt>size=3</tt>) or relative (<tt>size=-2</tt>). In
199the latter case the sizes are simply added.
200<li> <tt>face</tt> -- The family of the font, for example <tt>face=times</tt>.
201</ul>
202</table></center>
203<p> Special elements are:
204<center><table cellpadding="4" cellspacing="2" border="0">
205<tr bgcolor="#a2c511"> <th valign="top">Special tags <th valign="top">Notes
206<tr bgcolor="#f0f0f0"> <td valign="top"><tt>&lt;img&gt;</tt>
207<td valign="top">An image. The image name for the mime source factory is
208given in the source attribute, for example
209<tt>&lt;img src="qt.xpm"&gt;</tt> The image tag also understands the
210attributes <tt>width</tt> and <tt>height</tt> that determine the size
211of the image. If the pixmap does not fit the specified
212size it will be scaled automatically (by using
213<a href="qimage.html#smoothScale">QImage::smoothScale</a>()).
214<br>
215The <tt>align</tt> attribute determines where the image is
216placed. By default, an image is placed inline just like a
217normal character. Specify <tt>left</tt> or <tt>right</tt> to place the
218image at the respective side.
219<tr bgcolor="#d0d0d0"> <td valign="top"><tt>&lt;hr&gt;</tt>
220<td valign="top">A horizontal line.
221<tr bgcolor="#f0f0f0"> <td valign="top"><tt>&lt;br&gt;</tt>
222<td valign="top">A line break.
223<tr bgcolor="#d0d0d0"> <td valign="top"><tt>&lt;nobr&gt;...&lt;/nobr&gt;</tt>
224<td valign="top">No break. Prevents word wrap.
225</table></center>
226<p> In addition, rich text supports simple HTML tables. A table
227consists of one or more rows each of which contains one or more
228cells. Cells are either data cells or header cells, depending on
229their content. Cells which span rows and columns are supported.
230<p> <center><table cellpadding="4" cellspacing="2" border="0">
231<tr bgcolor="#a2c511"> <th valign="top">Table tags <th valign="top">Notes
232<tr bgcolor="#f0f0f0"> <td valign="top"><tt>&lt;table&gt;...&lt;/table&gt;</tt>
233<td valign="top">A table. Tables support the following attributes:
234<ul>
235<li> <tt>bgcolor</tt> -- The background color.
236<li> <tt>width</tt> -- The table width. This is either an absolute
237pixel width or a relative percentage of the table's
238width, for example <tt>width=80%</tt>.
239<li> <tt>border</tt> -- The width of the table border. The default is
2400 (= no border).
241<li> <tt>cellspacing</tt> -- Additional space around the table cells.
242The default is 2.
243<li> <tt>cellpadding</tt> -- Additional space around the contents of
244table cells. The default is 1.
245</ul>
246<tr bgcolor="#d0d0d0"> <td valign="top"><tt>&lt;tr&gt;...&lt;/tr&gt;</tt>
247<td valign="top">A table row. This is only valid within a <tt>table</tt>. Rows
248support the following attribute:
249<ul>
250<li> <tt>bgcolor</tt> -- The background color.
251</ul>
252<tr bgcolor="#f0f0f0"> <td valign="top"><tt>&lt;th&gt;...&lt;/th&gt;</tt>
253<td valign="top">A table header cell. Similar to <tt>td</tt>, but defaults to
254center alignment and a bold font.
255<tr bgcolor="#d0d0d0"> <td valign="top"><tt>&lt;td&gt;...&lt;/td&gt;</tt>
256<td valign="top">A table data cell. This is only valid within a <tt>tr</tt>.
257Cells support the following attributes:
258<ul>
259<li> <tt>bgcolor</tt> -- The background color.
260<li> <tt>width</tt> -- The cell width. This is either an absolute
261pixel width or a relative percentage of table's width,
262for example <tt>width=50%</tt>.
263<li> <tt>colspan</tt> -- Specifies how many columns this cell spans.
264The default is 1.
265<li> <tt>rowspan</tt> -- Specifies how many rows this cell spans. The
266default is 1.
267<li> <tt>align</tt> -- Alignment; possible values are <tt>left</tt>, <tt>right</tt>, and <tt>center</tt>. The default is <tt>left</tt>.
268<li> <tt>valign</tt> -- Vertical alignment; possible values are <tt>top</tt>, <tt>middle</tt>, and <tt>bottom</tt>. The default is <tt>middle</tt>.
269</ul>
270</table></center>
271<p>See also <a href="graphics.html">Graphics Classes</a>, <a href="helpsystem.html">Help System</a>, and <a href="text.html">Text Related Classes</a>.
272
273<hr><h2>Member Function Documentation</h2>
274<h3 class=fn><a name="QStyleSheet"></a>QStyleSheet::QStyleSheet ( <a href="qobject.html">QObject</a>&nbsp;*&nbsp;parent = 0, const&nbsp;char&nbsp;*&nbsp;name = 0 )
275</h3>
276Creates a style sheet called <em>name</em>, with parent <em>parent</em>. Like
277any <a href="qobject.html">QObject</a> it will be deleted when its parent is destroyed (if
278the child still exists).
279<p> By default the style sheet has the tag definitions defined above.
280
281<h3 class=fn><a name="~QStyleSheet"></a>QStyleSheet::~QStyleSheet ()<tt> [virtual]</tt>
282</h3>
283Destroys the style sheet. All styles inserted into the style sheet
284will be deleted.
285
286<h3 class=fn><a href="qstring.html">QString</a> <a name="convertFromPlainText"></a>QStyleSheet::convertFromPlainText ( const&nbsp;<a href="qstring.html">QString</a>&nbsp;&amp;&nbsp;plain, <a href="qstylesheetitem.html#WhiteSpaceMode-enum">QStyleSheetItem::WhiteSpaceMode</a>&nbsp;mode = QStyleSheetItem::WhiteSpacePre )<tt> [static]</tt>
287</h3> Auxiliary function. Converts the plain text string <em>plain</em> to a
288rich text formatted paragraph while preserving most of its look.
289<p> <em>mode</em> defines the whitespace mode. Possible values are <a href="qstylesheetitem.html#WhiteSpaceMode-enum">QStyleSheetItem::WhiteSpacePre</a> (no wrapping, all whitespaces
290preserved) and <a href="qstylesheetitem.html#WhiteSpaceMode-enum">QStyleSheetItem::WhiteSpaceNormal</a> (wrapping,
291simplified whitespaces).
292<p> <p>See also <a href="#escape">escape</a>().
293
294<p>Examples: <a href="qaction-application-example.html#x1163">action/application.cpp</a>, <a href="simple-application-example.html#x1581">application/application.cpp</a>, and <a href="mdi-example.html#x2067">mdi/application.cpp</a>.
295<h3 class=fn><a href="qstylesheet.html">QStyleSheet</a>&nbsp;* <a name="defaultSheet"></a>QStyleSheet::defaultSheet ()<tt> [static]</tt>
296</h3>
297Returns the application-wide default style sheet. This style sheet
298is used by rich text rendering classes such as <a href="qsimplerichtext.html">QSimpleRichText</a>,
299<a href="qwhatsthis.html">QWhatsThis</a> and <a href="qmessagebox.html">QMessageBox</a> to define the rendering style and
300available tags within rich text documents. It also serves as the
301initial style sheet for the more complex render widgets, <a href="qtextedit.html">QTextEdit</a>
302and <a href="qtextbrowser.html">QTextBrowser</a>.
303<p> <p>See also <a href="#setDefaultSheet">setDefaultSheet</a>().
304
305<h3 class=fn>void <a name="error"></a>QStyleSheet::error ( const&nbsp;<a href="qstring.html">QString</a>&nbsp;&amp;&nbsp;msg ) const<tt> [virtual]</tt>
306</h3>
307
308<p> This virtual function is called when an error occurs when
309processing rich text. Reimplement it if you need to catch error
310messages.
311<p> Errors might occur if some rich text strings contain tags that are
312not understood by the stylesheet, if some tags are nested
313incorrectly, or if tags are not closed properly.
314<p> <em>msg</em> is the error message.
315
316<h3 class=fn><a href="qstring.html">QString</a> <a name="escape"></a>QStyleSheet::escape ( const&nbsp;<a href="qstring.html">QString</a>&nbsp;&amp;&nbsp;plain )<tt> [static]</tt>
317</h3>
318Auxiliary function. Converts the plain text string <em>plain</em> to a
319rich text formatted string with any HTML meta-characters escaped.
320<p> <p>See also <a href="#convertFromPlainText">convertFromPlainText</a>().
321
322<h3 class=fn><a href="qstylesheetitem.html">QStyleSheetItem</a>&nbsp;* <a name="item"></a>QStyleSheet::item ( const&nbsp;<a href="qstring.html">QString</a>&nbsp;&amp;&nbsp;name )
323</h3>
324Returns the style called <em>name</em> or 0 if there is no such style.
325
326<h3 class=fn>const&nbsp;<a href="qstylesheetitem.html">QStyleSheetItem</a>&nbsp;* <a name="item-2"></a>QStyleSheet::item ( const&nbsp;<a href="qstring.html">QString</a>&nbsp;&amp;&nbsp;name ) const
327</h3>
328This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
329<p> Returns the style called <em>name</em> or 0 if there is no such style
330(const version)
331
332<h3 class=fn>bool <a name="mightBeRichText"></a>QStyleSheet::mightBeRichText ( const&nbsp;<a href="qstring.html">QString</a>&nbsp;&amp;&nbsp;text )<tt> [static]</tt>
333</h3>
334Returns TRUE if the string <em>text</em> is likely to be rich text;
335otherwise returns FALSE.
336<p> This function uses a fast and therefore simple heuristic. It
337mainly checks whether there is something that looks like a tag
338before the first line break. Although the result may be correct
339for common cases, there is no guarantee.
340
341<h3 class=fn>void <a name="scaleFont"></a>QStyleSheet::scaleFont ( <a href="qfont.html">QFont</a>&nbsp;&amp;&nbsp;font, int&nbsp;logicalSize ) const<tt> [virtual]</tt>
342</h3>
343Scales the font <em>font</em> to the appropriate physical point size
344corresponding to the logical font size <em>logicalSize</em>.
345<p> When calling this function, <em>font</em> has a point size corresponding
346to the logical font size 3.
347<p> Logical font sizes range from 1 to 7, with 1 being the smallest.
348<p> <p>See also <a href="qstylesheetitem.html#logicalFontSize">QStyleSheetItem::logicalFontSize</a>(), <a href="qstylesheetitem.html#logicalFontSizeStep">QStyleSheetItem::logicalFontSizeStep</a>(), and <a href="qfont.html#setPointSize">QFont::setPointSize</a>().
349
350<h3 class=fn>void <a name="setDefaultSheet"></a>QStyleSheet::setDefaultSheet ( <a href="qstylesheet.html">QStyleSheet</a>&nbsp;*&nbsp;sheet )<tt> [static]</tt>
351</h3>
352Sets the application-wide default style sheet to <em>sheet</em>,
353deleting any style sheet previously set. The ownership is
354transferred to QStyleSheet.
355<p> <p>See also <a href="#defaultSheet">defaultSheet</a>().
356
357<h3 class=fn>QTextCustomItem * <a name="tag"></a>QStyleSheet::tag ( const&nbsp;<a href="qstring.html">QString</a>&nbsp;&amp;&nbsp;name, const&nbsp;<a href="qmap.html">QMap</a>&lt;QString,&nbsp;QString&gt;&nbsp;&amp;&nbsp;attr, const&nbsp;<a href="qstring.html">QString</a>&nbsp;&amp;&nbsp;context, const&nbsp;<a href="qmimesourcefactory.html">QMimeSourceFactory</a>&nbsp;&amp;&nbsp;factory, bool&nbsp;emptyTag, QTextDocument&nbsp;*&nbsp;doc ) const<tt> [virtual]</tt>
358</h3>
359<p><b>This function is under development and is subject to change.</b>
360<p> Generates an internal object for the tag called <em>name</em>, given the
361attributes <em>attr</em>, and using additional information provided by
362the mime source factory <em>factory</em>.
363<p> <em>context</em> is the optional context of the document, i.e. the path
364to look for relative links. This becomes important if the text
365contains relative references, for example within image tags.
366<a href="qsimplerichtext.html">QSimpleRichText</a> always uses the default mime source factory (see
367<a href="qmimesourcefactory.html#defaultFactory">QMimeSourceFactory::defaultFactory</a>()) to resolve these
368references. The context will then be used to calculate the
369absolute path. See <a href="qmimesourcefactory.html#makeAbsolute">QMimeSourceFactory::makeAbsolute</a>() for details.
370<p> <em>emptyTag</em> and <em>doc</em> are for internal use only.
371<p> This function should not be used in application code.
372
373<!-- eof -->
374<hr><p>
375This file is part of the <a href="index.html">Qt toolkit</a>.
376Copyright &copy; 1995-2007
377<a href="http://www.trolltech.com/">Trolltech</a>. All Rights Reserved.<p><address><hr><div align=center>
378<table width=100% cellspacing=0 border=0><tr>
379<td>Copyright &copy; 2007
380<a href="troll.html">Trolltech</a><td align=center><a href="trademarks.html">Trademarks</a>
381<td align=right><div align=right>Qt 3.3.8</div>
382</table></div></address></body>
383</html>
Note: See TracBrowser for help on using the repository browser.