You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
384 lines
23 KiB
384 lines
23 KiB
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
|
<!-- /home/espenr/tmp/qt-3.3.8-espenr-2499/qt-x11-free-3.3.8/src/kernel/qstylesheet.cpp:854 -->
|
|
<html>
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
|
<title>TQStyleSheet Class</title>
|
|
<style type="text/css"><!--
|
|
fn { margin-left: 1cm; text-indent: -1cm; }
|
|
a:link { color: #004faf; text-decoration: none }
|
|
a:visited { color: #672967; text-decoration: none }
|
|
body { background: #ffffff; color: black; }
|
|
--></style>
|
|
</head>
|
|
<body>
|
|
|
|
<table border="0" cellpadding="0" cellspacing="0" width="100%">
|
|
<tr bgcolor="#E5E5E5">
|
|
<td valign=center>
|
|
<a href="index.html">
|
|
<font color="#004faf">Home</font></a>
|
|
| <a href="classes.html">
|
|
<font color="#004faf">All Classes</font></a>
|
|
| <a href="mainclasses.html">
|
|
<font color="#004faf">Main Classes</font></a>
|
|
| <a href="annotated.html">
|
|
<font color="#004faf">Annotated</font></a>
|
|
| <a href="groups.html">
|
|
<font color="#004faf">Grouped Classes</font></a>
|
|
| <a href="functions.html">
|
|
<font color="#004faf">Functions</font></a>
|
|
</td>
|
|
<td align="right" valign="center"><img src="logo32.png" align="right" width="64" height="32" border="0"></td></tr></table><h1 align=center>TQStyleSheet Class Reference</h1>
|
|
|
|
<p>The TQStyleSheet class is a collection of styles for rich text
|
|
rendering and a generator of tags.
|
|
<a href="#details">More...</a>
|
|
<p><tt>#include <<a href="qstylesheet-h.html">ntqstylesheet.h</a>></tt>
|
|
<p>Inherits <a href="tqobject.html">TQObject</a>.
|
|
<p><a href="qstylesheet-members.html">List of all member functions.</a>
|
|
<h2>Public Members</h2>
|
|
<ul>
|
|
<li class=fn><a href="#TQStyleSheet"><b>TQStyleSheet</b></a> ( TQObject * parent = 0, const char * name = 0 )</li>
|
|
<li class=fn>virtual <a href="#~TQStyleSheet"><b>~TQStyleSheet</b></a> ()</li>
|
|
<li class=fn>TQStyleSheetItem * <a href="#item"><b>item</b></a> ( const TQString & name )</li>
|
|
<li class=fn>const TQStyleSheetItem * <a href="#item-2"><b>item</b></a> ( const TQString & name ) const</li>
|
|
<li class=fn>virtual TQTextCustomItem * <a href="#tag"><b>tag</b></a> ( const TQString & name, const TQMap<TQString, TQString> & attr, const TQString & context, const TQMimeSourceFactory & factory, bool emptyTag, TQTextDocument * doc ) const</li>
|
|
<li class=fn>virtual void <a href="#scaleFont"><b>scaleFont</b></a> ( TQFont & font, int logicalSize ) const</li>
|
|
<li class=fn>virtual void <a href="#error"><b>error</b></a> ( const TQString & msg ) const</li>
|
|
</ul>
|
|
<h2>Static Public Members</h2>
|
|
<ul>
|
|
<li class=fn>TQStyleSheet * <a href="#defaultSheet"><b>defaultSheet</b></a> ()</li>
|
|
<li class=fn>void <a href="#setDefaultSheet"><b>setDefaultSheet</b></a> ( TQStyleSheet * sheet )</li>
|
|
<li class=fn>TQString <a href="#escape"><b>escape</b></a> ( const TQString & plain )</li>
|
|
<li class=fn>TQString <a href="#convertFromPlainText"><b>convertFromPlainText</b></a> ( const TQString & plain, TQStyleSheetItem::WhiteSpaceMode mode = TQStyleSheetItem::WhiteSpacePre )</li>
|
|
<li class=fn>bool <a href="#mightBeRichText"><b>mightBeRichText</b></a> ( const TQString & text )</li>
|
|
</ul>
|
|
<hr><a name="details"></a><h2>Detailed Description</h2>
|
|
|
|
|
|
|
|
The TQStyleSheet class is a collection of styles for rich text
|
|
rendering and a generator of tags.
|
|
<p>
|
|
|
|
<p> By creating <a href="qstylesheetitem.html">TQStyleSheetItem</a> objects for a style sheet you build a
|
|
definition of a set of tags. This definition will be used by the
|
|
internal rich text rendering system to parse and display text
|
|
documents to which the style sheet applies. Rich text is normally
|
|
visualized in a <a href="ntqtextedit.html">TQTextEdit</a> or a <a href="ntqtextbrowser.html">TQTextBrowser</a>. However, <a href="ntqlabel.html">TQLabel</a>,
|
|
<a href="ntqwhatsthis.html">TQWhatsThis</a> and <a href="ntqmessagebox.html">TQMessageBox</a> also support it, and other classes are
|
|
likely to follow. With <a href="ntqsimplerichtext.html">TQSimpleRichText</a> it is possible to use the
|
|
rich text renderer for custom widgets as well.
|
|
<p> The default TQStyleSheet object has the following style bindings,
|
|
sorted by structuring bindings, anchors, character style bindings
|
|
(i.e. inline styles), special elements such as horizontal lines or
|
|
images, and other tags. In addition, rich text supports simple
|
|
HTML tables.
|
|
<p> The structuring tags are
|
|
<center><table cellpadding="4" cellspacing="2" border="0">
|
|
<tr bgcolor="#a2c511"> <th valign="top">Structuring tags <th valign="top">Notes
|
|
<tr bgcolor="#f0f0f0"> <td valign="top"><tt><qt></tt>...<tt></qt></tt>
|
|
<td valign="top">A TQt rich text document. It understands the following
|
|
attributes:
|
|
<ul>
|
|
<li> <tt>title</tt> -- The caption of the document. This attribute is
|
|
easily accessible with <a href="ntqtextedit.html#documentTitle">TQTextEdit::documentTitle</a>().
|
|
<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
|
|
page of its own. Another style is <tt>detail</tt>, which can be
|
|
used to explain certain expressions in more detail in a
|
|
few sentences. For <tt>detail</tt>, <a href="ntqtextbrowser.html">TQTextBrowser</a> will then keep
|
|
the current page and display the new document in a small
|
|
popup similar to <a href="ntqwhatsthis.html">TQWhatsThis</a>. Note that links will not work
|
|
in documents with <tt><qt type="detail">...</qt></tt>.
|
|
<li> <tt>bgcolor</tt> -- The background color, for example <tt>bgcolor="yellow"</tt> or <tt>bgcolor="#0000FF"</tt>.
|
|
<li> <tt>background</tt> -- The background pixmap, for example <tt>background="granite.xpm"</tt>. The pixmap name will be resolved
|
|
by a <a href="qmimesourcefactory.html">TQMimeSourceFactory</a>().
|
|
<li> <tt>text</tt> -- The default text color, for example <tt>text="red"</tt>.
|
|
<li> <tt>link</tt> -- The link color, for example <tt>link="green"</tt>.
|
|
</ul>
|
|
<tr bgcolor="#d0d0d0"> <td valign="top"><tt><h1>...</h1></tt>
|
|
<td valign="top">A top-level heading.
|
|
<tr bgcolor="#f0f0f0"> <td valign="top"><tt><h2>...</h2></tt>
|
|
<td valign="top">A sublevel heading.
|
|
<tr bgcolor="#d0d0d0"> <td valign="top"><tt><h3>...</h3></tt>
|
|
<td valign="top">A sub-sublevel heading.
|
|
<tr bgcolor="#f0f0f0"> <td valign="top"><tt><h4>...</h4></tt> <tt><h5>...</h5></tt>
|
|
<td valign="top">Headings of lesser importance.
|
|
<tr bgcolor="#d0d0d0"> <td valign="top"><tt><p>...</p></tt>
|
|
<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
|
|
<tt>center</tt>.
|
|
<tr bgcolor="#f0f0f0"> <td valign="top"><tt><center>...</tt><br><tt></center></tt>
|
|
<td valign="top">A centered paragraph.
|
|
<tr bgcolor="#d0d0d0"> <td valign="top"><tt><blockquote>...</tt><br><tt></blockquote></tt>
|
|
<td valign="top">An indented paragraph that is useful for quotes.
|
|
<tr bgcolor="#f0f0f0"> <td valign="top"><tt><ul>...</ul></tt>
|
|
<td valign="top">An unordered list. You can also pass a type argument to
|
|
define the bullet style. The default is <tt>type=disc</tt>;
|
|
other types are <tt>circle</tt> and <tt>square</tt>.
|
|
<tr bgcolor="#d0d0d0"> <td valign="top"><tt><ol>...</ol></tt>
|
|
<td valign="top">An ordered list. You can also pass a type argument to
|
|
define the enumeration label style. The default is <tt>type="1"</tt>; other types are <tt>"a"</tt> and <tt>"A"</tt>.
|
|
<tr bgcolor="#f0f0f0"> <td valign="top"><tt><li>...</li></tt>
|
|
<td valign="top">A list item. This tag can be used only within the context
|
|
of <tt><ol></tt> or <tt><ul></tt>.
|
|
<tr bgcolor="#d0d0d0"> <td valign="top"><tt><dl>...</dl></tt>
|
|
<td valign="top">A list of definitions, consisting of terms and descriptions.
|
|
<tr bgcolor="#f0f0f0"> <td valign="top"><tt><dt>...</dt></tt>
|
|
<td valign="top">A term in a list of definitions. This tag can be used only
|
|
in the context of <tt><dl>...</dl></tt>.
|
|
<tr bgcolor="#d0d0d0"> <td valign="top"><tt><dd>...</dd></tt>
|
|
<td valign="top">A description in a list of definitions. This tag can be
|
|
used only in the context of <tt><dl>...</dl></tt>.
|
|
<tr bgcolor="#f0f0f0"> <td valign="top"><tt><pre>...</pre></tt>
|
|
<td valign="top">For larger chunks of code. Whitespaces in the contents are
|
|
preserved. For small bits of code use the inline-style <tt>code</tt>.
|
|
<tr bgcolor="#d0d0d0"> <td valign="top"><tt><div>...</div></tt> and <tt><span>...</span></tt>
|
|
<td valign="top">Block grouping elements. These are used to structure the
|
|
document, and are often used to provide hints about the
|
|
intended presentation of the document.
|
|
</table></center>
|
|
<p> Anchors and links are done with a single tag:
|
|
<center><table cellpadding="4" cellspacing="2" border="0">
|
|
<tr bgcolor="#a2c511"> <th valign="top">Anchor tags <th valign="top">Notes
|
|
<tr bgcolor="#f0f0f0"> <td valign="top"><tt><a>...</a></tt>
|
|
<td valign="top">An anchor or link.
|
|
<ul>
|
|
<li> A link is created by using an <tt>href</tt>
|
|
attribute, for example
|
|
<br><tt><a href="target.qml">Link Text</a></tt>. Links to
|
|
targets within a document are achieved in the same way
|
|
as for HTML, e.g.
|
|
<br><tt><a href="target.qml#subtitle">Link Text</a></tt>.
|
|
<li> A target is created by using a <a href="tqobject.html#name-prop">name</a>
|
|
attribute, for example
|
|
<br><tt><a name="subtitle"><h2>Sub Title</h2></a></tt>.
|
|
</ul>
|
|
</table></center>
|
|
<p> The default character style bindings are
|
|
<center><table cellpadding="4" cellspacing="2" border="0">
|
|
<tr bgcolor="#a2c511"> <th valign="top">Style tags <th valign="top">Notes
|
|
<tr bgcolor="#d0d0d0"> <td valign="top"><tt><em>...</em></tt>
|
|
<td valign="top">Emphasized. By default this is the same as <tt><i>...</i></tt>
|
|
(italic).
|
|
<tr bgcolor="#f0f0f0"> <td valign="top"><tt><strong>...</strong></tt>
|
|
<td valign="top">Strong. By default this is the same as <tt><b>...</b></tt>
|
|
(bold).
|
|
<tr bgcolor="#d0d0d0"> <td valign="top"><tt><i>...</i></tt>
|
|
<td valign="top">Italic font style.
|
|
<tr bgcolor="#f0f0f0"> <td valign="top"><tt><b>...</b></tt>
|
|
<td valign="top">Bold font style.
|
|
<tr bgcolor="#d0d0d0"> <td valign="top"><tt><u>...</u></tt>
|
|
<td valign="top">Underlined font style.
|
|
<tr bgcolor="#f0f0f0"> <td valign="top"><tt><s>...</s></tt>
|
|
<td valign="top">Strike out font style.
|
|
<tr bgcolor="#d0d0d0"> <td valign="top"><tt><big>...</big></tt>
|
|
<td valign="top">A larger font size.
|
|
<tr bgcolor="#f0f0f0"> <td valign="top"><tt><small>...</small></tt>
|
|
<td valign="top">A smaller font size.
|
|
<tr bgcolor="#d0d0d0"> <td valign="top"><tt><sub>...</sub></tt>
|
|
<td valign="top">Subscripted text
|
|
<tr bgcolor="#f0f0f0"> <td valign="top"><tt><sup>...</sup></tt>
|
|
<td valign="top">Superscripted text
|
|
<tr bgcolor="#d0d0d0"> <td valign="top"><tt><code>...</code></tt>
|
|
<td valign="top">Indicates code. By default this is the same as
|
|
<tt><tt>...</tt></tt> (typewriter). For larger chunks of code
|
|
use the block-tag <tt><</tt><tt>pre></tt>.
|
|
<tr bgcolor="#f0f0f0"> <td valign="top"><tt><tt>...</tt></tt>
|
|
<td valign="top">Typewriter font style.
|
|
<tr bgcolor="#d0d0d0"> <td valign="top"><tt><font>...</font></tt>
|
|
<td valign="top">Customizes the font size, family and text color. The tag
|
|
understands the following attributes:
|
|
<ul>
|
|
<li> <tt>color</tt> -- The text color, for example <tt>color="red"</tt> or
|
|
<tt>color="#FF0000"</tt>.
|
|
<li> <tt>size</tt> -- The logical size of the font. Logical sizes 1
|
|
to 7 are supported. The value may either be absolute
|
|
(for example, <tt>size=3</tt>) or relative (<tt>size=-2</tt>). In
|
|
the latter case the sizes are simply added.
|
|
<li> <tt>face</tt> -- The family of the font, for example <tt>face=times</tt>.
|
|
</ul>
|
|
</table></center>
|
|
<p> Special elements are:
|
|
<center><table cellpadding="4" cellspacing="2" border="0">
|
|
<tr bgcolor="#a2c511"> <th valign="top">Special tags <th valign="top">Notes
|
|
<tr bgcolor="#f0f0f0"> <td valign="top"><tt><img></tt>
|
|
<td valign="top">An image. The image name for the mime source factory is
|
|
given in the source attribute, for example
|
|
<tt><img src="qt.xpm"></tt> The image tag also understands the
|
|
attributes <tt>width</tt> and <tt>height</tt> that determine the size
|
|
of the image. If the pixmap does not fit the specified
|
|
size it will be scaled automatically (by using
|
|
<a href="tqimage.html#smoothScale">TQImage::smoothScale</a>()).
|
|
<br>
|
|
The <tt>align</tt> attribute determines where the image is
|
|
placed. By default, an image is placed inline just like a
|
|
normal character. Specify <tt>left</tt> or <tt>right</tt> to place the
|
|
image at the respective side.
|
|
<tr bgcolor="#d0d0d0"> <td valign="top"><tt><hr></tt>
|
|
<td valign="top">A horizontal line.
|
|
<tr bgcolor="#f0f0f0"> <td valign="top"><tt><br></tt>
|
|
<td valign="top">A line break.
|
|
<tr bgcolor="#d0d0d0"> <td valign="top"><tt><nobr>...</nobr></tt>
|
|
<td valign="top">No break. Prevents word wrap.
|
|
</table></center>
|
|
<p> In addition, rich text supports simple HTML tables. A table
|
|
consists of one or more rows each of which contains one or more
|
|
cells. Cells are either data cells or header cells, depending on
|
|
their content. Cells which span rows and columns are supported.
|
|
<p> <center><table cellpadding="4" cellspacing="2" border="0">
|
|
<tr bgcolor="#a2c511"> <th valign="top">Table tags <th valign="top">Notes
|
|
<tr bgcolor="#f0f0f0"> <td valign="top"><tt><table>...</table></tt>
|
|
<td valign="top">A table. Tables support the following attributes:
|
|
<ul>
|
|
<li> <tt>bgcolor</tt> -- The background color.
|
|
<li> <tt>width</tt> -- The table width. This is either an absolute
|
|
pixel width or a relative percentage of the table's
|
|
width, for example <tt>width=80%</tt>.
|
|
<li> <tt>border</tt> -- The width of the table border. The default is
|
|
0 (= no border).
|
|
<li> <tt>cellspacing</tt> -- Additional space around the table cells.
|
|
The default is 2.
|
|
<li> <tt>cellpadding</tt> -- Additional space around the contents of
|
|
table cells. The default is 1.
|
|
</ul>
|
|
<tr bgcolor="#d0d0d0"> <td valign="top"><tt><tr>...</tr></tt>
|
|
<td valign="top">A table row. This is only valid within a <tt>table</tt>. Rows
|
|
support the following attribute:
|
|
<ul>
|
|
<li> <tt>bgcolor</tt> -- The background color.
|
|
</ul>
|
|
<tr bgcolor="#f0f0f0"> <td valign="top"><tt><th>...</th></tt>
|
|
<td valign="top">A table header cell. Similar to <tt>td</tt>, but defaults to
|
|
center alignment and a bold font.
|
|
<tr bgcolor="#d0d0d0"> <td valign="top"><tt><td>...</td></tt>
|
|
<td valign="top">A table data cell. This is only valid within a <tt>tr</tt>.
|
|
Cells support the following attributes:
|
|
<ul>
|
|
<li> <tt>bgcolor</tt> -- The background color.
|
|
<li> <tt>width</tt> -- The cell width. This is either an absolute
|
|
pixel width or a relative percentage of table's width,
|
|
for example <tt>width=50%</tt>.
|
|
<li> <tt>colspan</tt> -- Specifies how many columns this cell spans.
|
|
The default is 1.
|
|
<li> <tt>rowspan</tt> -- Specifies how many rows this cell spans. The
|
|
default is 1.
|
|
<li> <tt>align</tt> -- Alignment; possible values are <tt>left</tt>, <tt>right</tt>, and <tt>center</tt>. The default is <tt>left</tt>.
|
|
<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>.
|
|
</ul>
|
|
</table></center>
|
|
<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>.
|
|
|
|
<hr><h2>Member Function Documentation</h2>
|
|
<h3 class=fn><a name="TQStyleSheet"></a>TQStyleSheet::TQStyleSheet ( <a href="tqobject.html">TQObject</a> * parent = 0, const char * name = 0 )
|
|
</h3>
|
|
Creates a style sheet called <em>name</em>, with parent <em>parent</em>. Like
|
|
any <a href="tqobject.html">TQObject</a> it will be deleted when its parent is destroyed (if
|
|
the child still exists).
|
|
<p> By default the style sheet has the tag definitions defined above.
|
|
|
|
<h3 class=fn><a name="~TQStyleSheet"></a>TQStyleSheet::~TQStyleSheet ()<tt> [virtual]</tt>
|
|
</h3>
|
|
Destroys the style sheet. All styles inserted into the style sheet
|
|
will be deleted.
|
|
|
|
<h3 class=fn><a href="ntqstring.html">TQString</a> <a name="convertFromPlainText"></a>TQStyleSheet::convertFromPlainText ( const <a href="ntqstring.html">TQString</a> & plain, <a href="qstylesheetitem.html#WhiteSpaceMode-enum">TQStyleSheetItem::WhiteSpaceMode</a> mode = TQStyleSheetItem::WhiteSpacePre )<tt> [static]</tt>
|
|
</h3> Auxiliary function. Converts the plain text string <em>plain</em> to a
|
|
rich text formatted paragraph while preserving most of its look.
|
|
<p> <em>mode</em> defines the whitespace mode. Possible values are <a href="qstylesheetitem.html#WhiteSpaceMode-enum">TQStyleSheetItem::WhiteSpacePre</a> (no wrapping, all whitespaces
|
|
preserved) and <a href="qstylesheetitem.html#WhiteSpaceMode-enum">TQStyleSheetItem::WhiteSpaceNormal</a> (wrapping,
|
|
simplified whitespaces).
|
|
<p> <p>See also <a href="#escape">escape</a>().
|
|
|
|
<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>.
|
|
<h3 class=fn><a href="ntqstylesheet.html">TQStyleSheet</a> * <a name="defaultSheet"></a>TQStyleSheet::defaultSheet ()<tt> [static]</tt>
|
|
</h3>
|
|
Returns the application-wide default style sheet. This style sheet
|
|
is used by rich text rendering classes such as <a href="ntqsimplerichtext.html">TQSimpleRichText</a>,
|
|
<a href="ntqwhatsthis.html">TQWhatsThis</a> and <a href="ntqmessagebox.html">TQMessageBox</a> to define the rendering style and
|
|
available tags within rich text documents. It also serves as the
|
|
initial style sheet for the more complex render widgets, <a href="ntqtextedit.html">TQTextEdit</a>
|
|
and <a href="ntqtextbrowser.html">TQTextBrowser</a>.
|
|
<p> <p>See also <a href="#setDefaultSheet">setDefaultSheet</a>().
|
|
|
|
<h3 class=fn>void <a name="error"></a>TQStyleSheet::error ( const <a href="ntqstring.html">TQString</a> & msg ) const<tt> [virtual]</tt>
|
|
</h3>
|
|
|
|
<p> This virtual function is called when an error occurs when
|
|
processing rich text. Reimplement it if you need to catch error
|
|
messages.
|
|
<p> Errors might occur if some rich text strings contain tags that are
|
|
not understood by the stylesheet, if some tags are nested
|
|
incorrectly, or if tags are not closed properly.
|
|
<p> <em>msg</em> is the error message.
|
|
|
|
<h3 class=fn><a href="ntqstring.html">TQString</a> <a name="escape"></a>TQStyleSheet::escape ( const <a href="ntqstring.html">TQString</a> & plain )<tt> [static]</tt>
|
|
</h3>
|
|
Auxiliary function. Converts the plain text string <em>plain</em> to a
|
|
rich text formatted string with any HTML meta-characters escaped.
|
|
<p> <p>See also <a href="#convertFromPlainText">convertFromPlainText</a>().
|
|
|
|
<h3 class=fn><a href="qstylesheetitem.html">TQStyleSheetItem</a> * <a name="item"></a>TQStyleSheet::item ( const <a href="ntqstring.html">TQString</a> & name )
|
|
</h3>
|
|
Returns the style called <em>name</em> or 0 if there is no such style.
|
|
|
|
<h3 class=fn>const <a href="qstylesheetitem.html">TQStyleSheetItem</a> * <a name="item-2"></a>TQStyleSheet::item ( const <a href="ntqstring.html">TQString</a> & name ) const
|
|
</h3>
|
|
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
|
|
<p> Returns the style called <em>name</em> or 0 if there is no such style
|
|
(const version)
|
|
|
|
<h3 class=fn>bool <a name="mightBeRichText"></a>TQStyleSheet::mightBeRichText ( const <a href="ntqstring.html">TQString</a> & text )<tt> [static]</tt>
|
|
</h3>
|
|
Returns TRUE if the string <em>text</em> is likely to be rich text;
|
|
otherwise returns FALSE.
|
|
<p> This function uses a fast and therefore simple heuristic. It
|
|
mainly checks whether there is something that looks like a tag
|
|
before the first line break. Although the result may be correct
|
|
for common cases, there is no guarantee.
|
|
|
|
<h3 class=fn>void <a name="scaleFont"></a>TQStyleSheet::scaleFont ( <a href="ntqfont.html">TQFont</a> & font, int logicalSize ) const<tt> [virtual]</tt>
|
|
</h3>
|
|
Scales the font <em>font</em> to the appropriate physical point size
|
|
corresponding to the logical font size <em>logicalSize</em>.
|
|
<p> When calling this function, <em>font</em> has a point size corresponding
|
|
to the logical font size 3.
|
|
<p> Logical font sizes range from 1 to 7, with 1 being the smallest.
|
|
<p> <p>See also <a href="qstylesheetitem.html#logicalFontSize">TQStyleSheetItem::logicalFontSize</a>(), <a href="qstylesheetitem.html#logicalFontSizeStep">TQStyleSheetItem::logicalFontSizeStep</a>(), and <a href="ntqfont.html#setPointSize">TQFont::setPointSize</a>().
|
|
|
|
<h3 class=fn>void <a name="setDefaultSheet"></a>TQStyleSheet::setDefaultSheet ( <a href="ntqstylesheet.html">TQStyleSheet</a> * sheet )<tt> [static]</tt>
|
|
</h3>
|
|
Sets the application-wide default style sheet to <em>sheet</em>,
|
|
deleting any style sheet previously set. The ownership is
|
|
transferred to TQStyleSheet.
|
|
<p> <p>See also <a href="#defaultSheet">defaultSheet</a>().
|
|
|
|
<h3 class=fn>TQTextCustomItem * <a name="tag"></a>TQStyleSheet::tag ( const <a href="ntqstring.html">TQString</a> & name, const <a href="tqmap.html">TQMap</a><TQString, TQString> & attr, const <a href="ntqstring.html">TQString</a> & context, const <a href="qmimesourcefactory.html">TQMimeSourceFactory</a> & factory, bool emptyTag, TQTextDocument * doc ) const<tt> [virtual]</tt>
|
|
</h3>
|
|
<p><b>This function is under development and is subject to change.</b>
|
|
<p> Generates an internal object for the tag called <em>name</em>, given the
|
|
attributes <em>attr</em>, and using additional information provided by
|
|
the mime source factory <em>factory</em>.
|
|
<p> <em>context</em> is the optional context of the document, i.e. the path
|
|
to look for relative links. This becomes important if the text
|
|
contains relative references, for example within image tags.
|
|
<a href="ntqsimplerichtext.html">TQSimpleRichText</a> always uses the default mime source factory (see
|
|
<a href="qmimesourcefactory.html#defaultFactory">TQMimeSourceFactory::defaultFactory</a>()) to resolve these
|
|
references. The context will then be used to calculate the
|
|
absolute path. See <a href="qmimesourcefactory.html#makeAbsolute">TQMimeSourceFactory::makeAbsolute</a>() for details.
|
|
<p> <em>emptyTag</em> and <em>doc</em> are for internal use only.
|
|
<p> This function should not be used in application code.
|
|
|
|
<!-- eof -->
|
|
<hr><p>
|
|
This file is part of the <a href="index.html">TQt toolkit</a>.
|
|
Copyright © 1995-2007
|
|
<a href="http://www.trolltech.com/">Trolltech</a>. All Rights Reserved.<p><address><hr><div align=center>
|
|
<table width=100% cellspacing=0 border=0><tr>
|
|
<td>Copyright © 2007
|
|
<a href="troll.html">Trolltech</a><td align=center><a href="trademarks.html">Trademarks</a>
|
|
<td align=right><div align=right>TQt 3.3.8</div>
|
|
</table></div></address></body>
|
|
</html>
|