.BI "bool \fBmightBeRichText\fR ( const QString & text )"
.br
.in -1c
.SH DESCRIPTION
The QStyleSheet class is a collection of styles for rich text rendering and a generator of tags.
.PP
By creating QStyleSheetItem 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 QTextEdit or a QTextBrowser. However, QLabel, QWhatsThis and QMessageBox also support it, and other classes are likely to follow. With QSimpleRichText it is possible to use the rich text renderer for custom widgets as well.
.PP
The default QStyleSheet 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.
.PP
The structuring tags are <center>.nf
.TS
l - l. Structuring tags Notes A Qt rich text document. It understands the following attributes:
.TP
A top-level heading.
A sublevel heading.
A sub-sublevel heading.
Headings of lesser importance.
A left-aligned paragraph. Adjust the alignment with the
A centered paragraph.
An indented paragraph that is useful for quotes.
An unordered list. You can also pass a type argument to
define the bullet style. The default is
An ordered list. You can also pass a type argument to
define the enumeration label style. The default is
A list item. This tag can be used only within the context
of
A list of definitions, consisting of terms and descriptions.
A term in a list of definitions. This tag can be used only
in the context of
A description in a list of definitions. This tag can be
used only in the context of
For larger chunks of code. Whitespaces in the contents are
preserved. For small bits of code use the inline-style
.TE
.fi
</center>
.PP
Anchors and links are done with a single tag: <center>.nf
.TS
l - l. Anchor tags Notes An anchor or link.
.TP
A link is created by using an
.TE
.fi
</center>
.PP
The default character style bindings are <center>.nf
.TS
l - l. Style tags Notes Emphasized. By default this is the same as Strong. By default this is the same as Italic font style. Bold font style. Underlined font style. Strike out font style. A larger font size. A smaller font size. Subscripted text Superscripted text Indicates code. By default this is the same as Typewriter font style. Customizes the font size, family and text color. The tag understands the following attributes:
.TP
.TE
.fi
</center>
.PP
Special elements are: <center>.nf
.TS
l
-
l.
Special tags Notes
An image. The image name for the mime source factory is
given in the source attribute, for example
A horizontal line.
A line break.
.TE
.fi
</center>
.PP
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.
.PP
<center>.nf
.TS
l - l. Table tags Notes A table. Tables support the following attributes:
.TP
A table row. This is only valid within a A table header cell. Similar to A table data cell. This is only valid within a
.TE
.fi
</center>
.PP
See also Graphics Classes, Help System, and Text Related Classes.
Creates a style sheet called \fIname\fR, with parent \fIparent\fR. Like any QObject it will be deleted when its parent is destroyed (if the child still exists).
.PP
By default the style sheet has the tag definitions defined above.
Auxiliary function. Converts the plain text string \fIplain\fR to a rich text formatted paragraph while preserving most of its look.
.PP
\fImode\fR defines the whitespace mode. Possible values are QStyleSheetItem::WhiteSpacePre (no wrapping, all whitespaces preserved) and QStyleSheetItem::WhiteSpaceNormal (wrapping, simplified whitespaces).
.PP
See also escape().
.PP
Examples:
.)l action/application.cpp, application/application.cpp, and mdi/application.cpp.
Returns the application-wide default style sheet. This style sheet is used by rich text rendering classes such as QSimpleRichText, QWhatsThis and QMessageBox 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, QTextEdit and QTextBrowser.
This virtual function is called when an error occurs when processing rich text. Reimplement it if you need to catch error messages.
.PP
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.
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
.PP
Returns the style called \fIname\fR or 0 if there is no such style (const version)
.SH "bool QStyleSheet::mightBeRichText ( const QString & text )\fC [static]\fR"
Returns TRUE if the string \fItext\fR is likely to be rich text; otherwise returns FALSE.
.PP
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.
\fBThis function is under development and is subject to change.\fR
.PP
Generates an internal object for the tag called \fIname\fR, given the attributes \fIattr\fR, and using additional information provided by the mime source factory \fIfactory\fR.
.PP
\fIcontext\fR 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. QSimpleRichText always uses the default mime source factory (see QMimeSourceFactory::defaultFactory()) to resolve these references. The context will then be used to calculate the absolute path. See QMimeSourceFactory::makeAbsolute() for details.
.PP
\fIemptyTag\fR and \fIdoc\fR are for internal use only.
.PP
This function should not be used in application code.