qstylesheetitem.html
来自「QT 下载资料仅供参考」· HTML 代码 · 共 485 行 · 第 1/2 页
HTML
485 行
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><!-- /home/reggie/tmp/qt-3.0-reggie-5401/qt-x11-commercial-3.0.5/src/kernel/qstylesheet.cpp:77 --><html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>QStyleSheetItem Class</title><style type="text/css"><!--h3.fn,span.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>QStyleSheetItem Class Reference</h1><p>The QStyleSheetItem class provides an encapsulation of a set of text styles.<a href="#details">More...</a><p><tt>#include <<a href="qstylesheet-h.html">qstylesheet.h</a>></tt><p>Inherits <a href="qt.html">Qt</a>.<p><a href="qstylesheetitem-members.html">List of all member functions.</a><h2>Public Members</h2><ul><li><div class=fn><a href="#QStyleSheetItem"><b>QStyleSheetItem</b></a> ( QStyleSheet * parent, const QString & name )</div></li><li><div class=fn><a href="#QStyleSheetItem-2"><b>QStyleSheetItem</b></a> ( const QStyleSheetItem & other )</div></li><li><div class=fn><a href="#~QStyleSheetItem"><b>~QStyleSheetItem</b></a> ()</div></li><li><div class=fn>QString <a href="#name"><b>name</b></a> () const</div></li><li><div class=fn>QStyleSheet * <a href="#styleSheet"><b>styleSheet</b></a> ()</div></li><li><div class=fn>const QStyleSheet * <a href="#styleSheet-2"><b>styleSheet</b></a> () const</div></li><li><div class=fn>enum <a href="#DisplayMode-enum"><b>DisplayMode</b></a> { DisplayBlock, DisplayInline, DisplayListItem, DisplayNone }</div></li><li><div class=fn>DisplayMode <a href="#displayMode"><b>displayMode</b></a> () const</div></li><li><div class=fn>void <a href="#setDisplayMode"><b>setDisplayMode</b></a> ( DisplayMode m )</div></li><li><div class=fn>int <a href="#alignment"><b>alignment</b></a> () const</div></li><li><div class=fn>void <a href="#setAlignment"><b>setAlignment</b></a> ( int f )</div></li><li><div class=fn>enum <a href="#VerticalAlignment-enum"><b>VerticalAlignment</b></a> { VAlignBaseline, VAlignSub, VAlignSuper }</div></li><li><div class=fn>VerticalAlignment <a href="#verticalAlignment"><b>verticalAlignment</b></a> () const</div></li><li><div class=fn>void <a href="#setVerticalAlignment"><b>setVerticalAlignment</b></a> ( VerticalAlignment valign )</div></li><li><div class=fn>int <a href="#fontWeight"><b>fontWeight</b></a> () const</div></li><li><div class=fn>void <a href="#setFontWeight"><b>setFontWeight</b></a> ( int w )</div></li><li><div class=fn>int <a href="#logicalFontSize"><b>logicalFontSize</b></a> () const</div></li><li><div class=fn>void <a href="#setLogicalFontSize"><b>setLogicalFontSize</b></a> ( int s )</div></li><li><div class=fn>int <a href="#logicalFontSizeStep"><b>logicalFontSizeStep</b></a> () const</div></li><li><div class=fn>void <a href="#setLogicalFontSizeStep"><b>setLogicalFontSizeStep</b></a> ( int s )</div></li><li><div class=fn>int <a href="#fontSize"><b>fontSize</b></a> () const</div></li><li><div class=fn>void <a href="#setFontSize"><b>setFontSize</b></a> ( int s )</div></li><li><div class=fn>QString <a href="#fontFamily"><b>fontFamily</b></a> () const</div></li><li><div class=fn>void <a href="#setFontFamily"><b>setFontFamily</b></a> ( const QString & fam )</div></li><li><div class=fn>int numberOfColumns () const <em>(obsolete)</em></div></li><li><div class=fn>void setNumberOfColumns ( int ncols ) <em>(obsolete)</em></div></li><li><div class=fn>QColor <a href="#color"><b>color</b></a> () const</div></li><li><div class=fn>void <a href="#setColor"><b>setColor</b></a> ( const QColor & c )</div></li><li><div class=fn>bool <a href="#fontItalic"><b>fontItalic</b></a> () const</div></li><li><div class=fn>void <a href="#setFontItalic"><b>setFontItalic</b></a> ( bool italic )</div></li><li><div class=fn>bool <a href="#definesFontItalic"><b>definesFontItalic</b></a> () const</div></li><li><div class=fn>bool <a href="#fontUnderline"><b>fontUnderline</b></a> () const</div></li><li><div class=fn>void <a href="#setFontUnderline"><b>setFontUnderline</b></a> ( bool underline )</div></li><li><div class=fn>bool <a href="#definesFontUnderline"><b>definesFontUnderline</b></a> () const</div></li><li><div class=fn>bool <a href="#fontStrikeOut"><b>fontStrikeOut</b></a> () const</div></li><li><div class=fn>void <a href="#setFontStrikeOut"><b>setFontStrikeOut</b></a> ( bool strikeOut )</div></li><li><div class=fn>bool <a href="#definesFontStrikeOut"><b>definesFontStrikeOut</b></a> () const</div></li><li><div class=fn>bool <a href="#isAnchor"><b>isAnchor</b></a> () const</div></li><li><div class=fn>void <a href="#setAnchor"><b>setAnchor</b></a> ( bool anc )</div></li><li><div class=fn>enum <a href="#WhiteSpaceMode-enum"><b>WhiteSpaceMode</b></a> { WhiteSpaceNormal, WhiteSpacePre, WhiteSpaceNoWrap }</div></li><li><div class=fn>WhiteSpaceMode <a href="#whiteSpaceMode"><b>whiteSpaceMode</b></a> () const</div></li><li><div class=fn>void <a href="#setWhiteSpaceMode"><b>setWhiteSpaceMode</b></a> ( WhiteSpaceMode m )</div></li><li><div class=fn>enum <a href="#Margin-enum"><b>Margin</b></a> { MarginLeft, MarginRight, MarginTop, MarginBottom, MarginFirstLine, MarginAll, MarginVertical, MarginHorizontal }</div></li><li><div class=fn>int <a href="#margin"><b>margin</b></a> ( Margin m ) const</div></li><li><div class=fn>void <a href="#setMargin"><b>setMargin</b></a> ( Margin m, int v )</div></li><li><div class=fn>enum <a href="#ListStyle-enum"><b>ListStyle</b></a> { ListDisc, ListCircle, ListSquare, ListDecimal, ListLowerAlpha, ListUpperAlpha }</div></li><li><div class=fn>ListStyle <a href="#listStyle"><b>listStyle</b></a> () const</div></li><li><div class=fn>void <a href="#setListStyle"><b>setListStyle</b></a> ( ListStyle s )</div></li><li><div class=fn>QString <a href="#contexts"><b>contexts</b></a> () const</div></li><li><div class=fn>void <a href="#setContexts"><b>setContexts</b></a> ( const QString & c )</div></li><li><div class=fn>bool <a href="#allowedInContext"><b>allowedInContext</b></a> ( const QStyleSheetItem * s ) const</div></li><li><div class=fn>bool <a href="#selfNesting"><b>selfNesting</b></a> () const</div></li><li><div class=fn>void <a href="#setSelfNesting"><b>setSelfNesting</b></a> ( bool nesting )</div></li><li><div class=fn>void <b>setLineSpacing</b> ( int ls )</div></li><li><div class=fn>int lineSpacing () const <em>(obsolete)</em></div></li></ul><hr><a name="details"></a><h2>Detailed Description</h2>The QStyleSheetItem class provides an encapsulation of a set of text styles.<p> <p> A style sheet item consists of a name and a set of attributes thatspecifiy its font, color, etc. When used in a <a href="qstylesheet.html">style sheet</a> (see <a href="#styleSheet">styleSheet</a>()), items define the <a href="#name">name</a>() ofa rich text tag and the display property changes associated withit.<p> The <a href="#DisplayMode-enum">display mode</a>attribute indicates whether the item is a block, an inline elementor a list element; see <a href="#setDisplayMode">setDisplayMode</a>(). The treatment ofwhitespace is controlled by the <a href="#WhiteSpaceMode-enum">white space mode</a>; see<a href="#setWhiteSpaceMode">setWhiteSpaceMode</a>(). An item's margins are set with <a href="#setMargin">setMargin</a>(),In the case of list items, the list style is set with<a href="#setListStyle">setListStyle</a>(). An item may be a hypertext link anchor; see<a href="#setAnchor">setAnchor</a>(). Other attributes are set with <a href="#setAlignment">setAlignment</a>(),<a href="#setVerticalAlignment">setVerticalAlignment</a>(), <a href="#setFontFamily">setFontFamily</a>(), <a href="#setFontSize">setFontSize</a>(),<a href="#setFontWeight">setFontWeight</a>(), <a href="#setFontItalic">setFontItalic</a>(), <a href="#setFontUnderline">setFontUnderline</a>(),setFontStrikeOut and <a href="#setColor">setColor</a>().<p>See also <a href="text.html">Text Related Classes</a>.<hr><h2>Member Type Documentation</h2><h3 class=fn><a name="DisplayMode-enum"></a>QStyleSheetItem::DisplayMode</h3><p> This enum type defines the way adjacent elements are displayed.<ul><li><tt>QStyleSheetItem::DisplayBlock</tt> - elements are displayed as a rectangular block(e.g. <tt><p>...</p></tt>).<li><tt>QStyleSheetItem::DisplayInline</tt> - elements are displayed in a horizontallyflowing sequence (e.g. <tt><em>...</em></tt>).<li><tt>QStyleSheetItem::DisplayListItem</tt> - elements are displayed in a verticalsequence (e.g. <tt><li>...</li></tt>).<li><tt>QStyleSheetItem::DisplayNone</tt> - elements are not displayed at all.</ul><h3 class=fn><a name="ListStyle-enum"></a>QStyleSheetItem::ListStyle</h3><p> This enum type defines how the items in a list are prefixed whendisplayed.<ul><li><tt>QStyleSheetItem::ListDisc</tt> - a filled circle (i.e. a bullet)<li><tt>QStyleSheetItem::ListCircle</tt> - an unfilled circle<li><tt>QStyleSheetItem::ListSquare</tt> - a filled square<li><tt>QStyleSheetItem::ListDecimal</tt> - an integer in base 10: <em>1</em>, <em>2</em>, <em>3</em>, ...<li><tt>QStyleSheetItem::ListLowerAlpha</tt> - a lowercase letter: <em>a</em>, <em>b</em>, <em>c</em>, ...<li><tt>QStyleSheetItem::ListUpperAlpha</tt> - an uppercase letter: <em>A</em>, <em>B</em>, <em>C</em>, ...</ul><h3 class=fn><a name="Margin-enum"></a>QStyleSheetItem::Margin</h3><ul><li><tt>QStyleSheetItem::MarginLeft</tt> - left margin<li><tt>QStyleSheetItem::MarginRight</tt> - right margin<li><tt>QStyleSheetItem::MarginTop</tt> - top margin<li><tt>QStyleSheetItem::MarginBottom</tt> - bottom margin<li><tt>QStyleSheetItem::MarginAll</tt> - all margins (left, right, top and bottom)<li><tt>QStyleSheetItem::MarginVertical</tt> - top and bottom margins<li><tt>QStyleSheetItem::MarginHorizontal</tt> - left and right margins<li><tt>QStyleSheetItem::MarginFirstLine</tt> - margin (indentation) of the first line ofa paragarph (in addition to the MarginLeft of the paragraph)</ul><h3 class=fn><a name="VerticalAlignment-enum"></a>QStyleSheetItem::VerticalAlignment</h3><p> This enum type defines the way elements are aligned vertically.This is only supported for text elements.<ul><li><tt>QStyleSheetItem::VAlignBaseline</tt> - align the baseline of the element (or thebottom, if the element doesn't have a baseline) with thebaseline of the parent<li><tt>QStyleSheetItem::VAlignSub</tt> - subscript the element<li><tt>QStyleSheetItem::VAlignSuper</tt> - superscript the element</ul><p> <h3 class=fn><a name="WhiteSpaceMode-enum"></a>QStyleSheetItem::WhiteSpaceMode</h3><p> This enum defines the ways in which <a href="qstylesheet.html">QStyleSheet</a> can treatwhitespace.<ul><li><tt>QStyleSheetItem::WhiteSpaceNormal</tt> - any sequence of whitespace (includingline-breaks) is equivalent to a single space.<li><tt>QStyleSheetItem::WhiteSpacePre</tt> - whitespace must be output exactly as givenin the input.<li><tt>QStyleSheetItem::WhiteSpaceNoWrap</tt> - multiple spaces are collapsed as withWhiteSpaceNormal, but no automatic line-breaks occur. To breaklines manually, use the <tt><br></tt> tag.</ul><p> <hr><h2>Member Function Documentation</h2><h3 class=fn><a name="QStyleSheetItem"></a>QStyleSheetItem::QStyleSheetItem ( <a href="qstylesheet.html">QStyleSheet</a> * parent, const <a href="qstring.html">QString</a> & name )</h3>Constructs a new style called <em>name</em> for the stylesheet <em>parent</em>.<p> All properties in QStyleSheetItem are initially in the "do notchange" state, except <a href="#DisplayMode-enum">display mode</a>, which defaults to <a href="#DisplayMode-enum">DisplayInline</a>.<h3 class=fn><a name="QStyleSheetItem-2"></a>QStyleSheetItem::QStyleSheetItem ( const <a href="qstylesheetitem.html">QStyleSheetItem</a> & other )</h3>Copy constructor. Constructs a copy of <em>other</em> that is not boundto any style sheet.<h3 class=fn><a name="~QStyleSheetItem"></a>QStyleSheetItem::~QStyleSheetItem ()</h3>Destroys the style. Note that QStyleSheetItem objects becomeowned by <a href="qstylesheet.html">QStyleSheet</a> when they are created.<h3 class=fn>int <a name="alignment"></a>QStyleSheetItem::alignment () const</h3>Returns the alignment of this style. Possible values are <a href="qt.html#AlignmentFlags-enum">AlignAuto</a>, <a href="qt.html#AlignmentFlags-enum">AlignLeft</a>, <a href="qt.html#AlignmentFlags-enum">AlignRight</a>, <a href="qt.html#AlignmentFlags-enum">AlignCenter</a> or <a href="qt.html#AlignmentFlags-enum">AlignJustify</a>.<p> <p>See also <a href="#setAlignment">setAlignment</a>() and <a href="qt.html#AlignmentFlags-enum">Qt::AlignmentFlags</a>.<h3 class=fn>bool <a name="allowedInContext"></a>QStyleSheetItem::allowedInContext ( const <a href="qstylesheetitem.html">QStyleSheetItem</a> * s ) const</h3>Returns TRUE if this style can be nested into an element of style<em>s</em>; otherwise returns FALSE.<p> <p>See also <a href="#contexts">contexts</a>() and <a href="#setContexts">setContexts</a>().<h3 class=fn><a href="qcolor.html">QColor</a> <a name="color"></a>QStyleSheetItem::color () const</h3>Returns the text color of this style or an invalid color if nocolor has been set.<p> <p>See also <a href="#setColor">setColor</a>() and <a href="qcolor.html#isValid">QColor::isValid</a>().<h3 class=fn><a href="qstring.html">QString</a> <a name="contexts"></a>QStyleSheetItem::contexts () const</h3>Returns a space-separated list of names of styles that may containelements of this style. If nothing has been set, <a href="#contexts">contexts</a>()returns an empty string, which indicates that this style can benested everywhere.<p> <p>See also <a href="#setContexts">setContexts</a>().<h3 class=fn>bool <a name="definesFontItalic"></a>QStyleSheetItem::definesFontItalic () const</h3>Returns TRUE if the style defines a font shape; otherwise returnsFALSE. A style does not define any shape until <a href="#setFontItalic">setFontItalic</a>() iscalled.<p> <p>See also <a href="#setFontItalic">setFontItalic</a>() and <a href="#fontItalic">fontItalic</a>().<h3 class=fn>bool <a name="definesFontStrikeOut"></a>QStyleSheetItem::definesFontStrikeOut () const</h3>Returns TRUE if the style defines a setting for the strikeOutproperty of the font; otherwise returns FALSE. A style does notdefine this until <a href="#setFontStrikeOut">setFontStrikeOut</a>() is called.<p> <p>See also <a href="#setFontStrikeOut">setFontStrikeOut</a>() and <a href="#fontStrikeOut">fontStrikeOut</a>().<h3 class=fn>bool <a name="definesFontUnderline"></a>QStyleSheetItem::definesFontUnderline () const</h3>Returns TRUE if the style defines a setting for the underlineproperty of the font; otherwise returns FALSE. A style does notdefine this until <a href="#setFontUnderline">setFontUnderline</a>() is called.<p> <p>See also <a href="#setFontUnderline">setFontUnderline</a>() and <a href="#fontUnderline">fontUnderline</a>().
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?