The QStyleSheetItem class encapsulates a text format. More...
#include <qstylesheet.h>
Inherits Qt.
A style consists of a name and a set of font, color, and other display properties. When used in a style sheet, items define the name of a rich text tag, and the display property changes associated with it.
Examples: qbrowser/main.cpp
DisplayBlock
- elements are displayed as a rectangular block.
(eg. <P> ... </P>)
DisplayInline
- elements are displayed in a horizontally flowing sequence.
(eg. <EM> ... </EM>)
DisplayListItem
- elements are displayed in a vertically sequence.
(eg. <EM> ... </EM>)
DisplayNone
- elements are not displayed at all.
ListDisc
- a filled circle
ListCircle
- an unfilled circle
ListSquare
- a filled circle
ListDecimal
- an integer in base 10: 1, 2, 3, ...
ListLowerAlpha
- a lowercase letter: a, b, c, ...
ListUpperAlpha
- an uppercase letter: A, B, C, ...
Constructs a new style named name for the stylesheet parent.
All properties in QStyleSheetItem are initially in the "do not change" state,
except display mode, which defaults
to DisplayInline.
Destroys the style. Note that QStyleSheetItem objects become owned by QStyleSheet when they are created.
Returns the alignment of this style. Possible values are AlignLeft, AlignRight and AlignCenter.
See also: setAlignment().
Returns whether this style can be nested into an element of style s .
See also: contxts() and setContexts().
Returns the text color of this style, or an invalid color if no color has been set yet.
See also: setColor().
Returns a space separated list of names of styles that may contain elements of this style. As default, contexs() returns an empty string, which indicates that this style can be nested everywhere.
See also: setContexts().
Returns whether the style defines a font shape. A style does not define any shape until setFontItalic() is called.
See also: setFontItalic() and fontItalic().
Returns whether the style defines a setting for the underline property of the font. A style does not define this until setFontUnderline() is called.
See also: setFontUnderline() and fontUnderline().
Returns the display mode of the style.
See also: setDisplayMode().
Returns the font family setting of the style. This is either a valid font family or QString::null if no family has been set.
See also: setFontFamily(), QFont::family() and QFont::setFamily().
Returns whether the styles sets an italic or upright font.
See also: setFontItalic() and definesFontItalic().
Returns the font size setting of the style. This is either a valid pointsize or QStyleSheetItem::Undefined.
See also: setFontSize(), QFont::pointSize() and QFont::setPointSize().
Returns whether the styles sets an underlined font.
See also: setFontUnderline() and definesFontUnderline().
Returns the font weight setting of the style. This is either a valid QFont::Weight or the value QStyleSheetItem::Undefined.
See also: setFontWeight and QFont.
Returns whether this style is an anchor.
See also: setAnchor().
Returns the list style of the style.
See also: setListStyle().
Returns the logical font size setting of the style. This is either a valid size between 1 and 7 or QStyleSheetItem::Undefined.
See also: setLogicalFontSize(), setLogicalFontSizeStep(), QFont::pointSize() and QFont::setPointSize().
Returns the logical font size step of this style.
The default is 0. Tags like big
define +1, small
defines
-1
See also: setLogicalFontSizeStep().
Returns the width of margin m in pixel.
The margin determinator m can be MarginLeft, MarginRight, MarginTop, MarginBottom, MarginAll, MarginVertical
or MarginHorizontal.
See also: setMargin().
Returns the name of style.
Returns the number of columns for this style.
See also: setNumberOfColumns(), displayMode() and setDisplayMode().
Returns whether this style has self nesting enabled.
See also: setSelfNesting().
Sets the alignment. This only makes sense for styles with display mode DisplayBlock. Possible values are AlignLeft, AlignRight and AlignCenter.
See also: alignment() and displayMode().
Sets whether the style is an anchor (link). Elements in this style have connections to other documents or anchors.
See also: isAnchor().
Sets the text color of this style.
See also: color().
Sets a space separated list of names of styles that may contain elements of this style. If c is empty, the style can be nested everywhere.
See also: contexts().
Examples: qbrowser/main.cpp
Sets the display mode of the style to m.
See also: displayMode().
Examples: qbrowser/main.cpp
Sets the font family setting of the style.
See also: fontFamily(), QFont::family() and QFont::setFamily().
Sets italic or upright shape for the style.
See also: fontItalic() and definesFontItalic().
Sets the font size setting of the style, in point measures.
See also: fontSize(), QFont::pointSize() and QFont::setPointSize().
Sets underline for the style.
See also: fontUnderline() and definesFontUnderline().
Sets the font weight setting of the style. Valid values are those defined by QFont::Weight.
See also: QFont and fontWeight().
Sets the list style of the style.
This is used by nested elements which have a display mode of DisplayListItem.
See also: listStyle() and DisplayMode.
Sets the logical font size setting of the style tp s. Valid logical sizes are 1 to 7.
See also: logicalFontSize(), QFont::pointSize() and QFont::setPointSize().
Sets the logical font size step of this style to s.
See also: logicalFontSizeStep().
Sets the width of margin m to v pixels.
The margin determinator m can be MarginLeft, MarginRight, MarginTop, MarginBottom, MarginAll, MarginVertical
or MarginHorizontal.
The value v must be >= 0.
See also: border().
Sets the number of columns for this style. Elements in the style are divided into columns.
This only makes sense if the style uses a block display mode.
See also: numberOfColumns().
Sets the self nesting property for this style to nesting.
Usually, all styles are self nesting, i.e. they can legally be nested recursively. A paragraph, for example, might contain other paragraphs as subparagraphs.
You may nevertheles want to disable self nesting for common HTML
tags such as <p>
or <li>,
if you want to parse and
display rich text documents based on "dirty" HTML. However, we
recommend fixing the documents instead to close all non-empty tags,
if that is possible.
Sets the white space mode to m. Possible values are
WhiteSpaceNormal
- white spaces in the document only serve as seperators.
Multiple spaces or indentation therefore is ignored.
WhiteSpacePre
- white spaces are preserved. This is particulary useful to
display programming code.
Returns the stylesheet this item is in.
Returns the stylesheet this item is in.
Search the documentation, FAQ, qt-interest archive and more (uses
www.troll.no):
This file is part of the Qt toolkit, copyright © 1995-99 Troll Tech, all rights reserved.
Copyright © 1999 Troll Tech | Trademarks | Qt version 2.0.2
|