⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 qstylesheet.html

📁 QT 下载资料仅供参考
💻 HTML
📖 第 1 页 / 共 2 页
字号:
<!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:834 --><html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>QStyleSheet 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&nbsp;Classes</font></a> | <a href="mainclasses.html"><font color="#004faf">Main&nbsp;Classes</font></a> | <a href="annotated.html"><font color="#004faf">Annotated</font></a> | <a href="groups.html"><font color="#004faf">Grouped&nbsp;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>QStyleSheet Class Reference</h1><p>The QStyleSheet class is a collection of styles for rich textrendering and a generator of tags.<a href="#details">More...</a><p><tt>#include &lt;<a href="qstylesheet-h.html">qstylesheet.h</a>&gt;</tt><p>Inherits <a href="qobject.html">QObject</a>.<p><a href="qstylesheet-members.html">List of all member functions.</a><h2>Public Members</h2><ul><li><div class=fn><a href="#QStyleSheet"><b>QStyleSheet</b></a> ( QObject&nbsp;*&nbsp;parent = 0, const&nbsp;char&nbsp;*&nbsp;name = 0 )</div></li><li><div class=fn>virtual <a href="#~QStyleSheet"><b>~QStyleSheet</b></a> ()</div></li><li><div class=fn>QStyleSheetItem * <a href="#item"><b>item</b></a> ( const&nbsp;QString&nbsp;&amp;&nbsp;name )</div></li><li><div class=fn>const QStyleSheetItem * <a href="#item-2"><b>item</b></a> ( const&nbsp;QString&nbsp;&amp;&nbsp;name ) const</div></li><li><div 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</div></li><li><div class=fn>virtual void <a href="#scaleFont"><b>scaleFont</b></a> ( QFont&nbsp;&amp;&nbsp;font, int&nbsp;logicalSize ) const</div></li><li><div class=fn>virtual void <a href="#error"><b>error</b></a> ( const&nbsp;QString&nbsp;&amp;&nbsp;msg ) const</div></li></ul><h2>Static Public Members</h2><ul><li><div class=fn>QStyleSheet * <a href="#defaultSheet"><b>defaultSheet</b></a> ()</div></li><li><div class=fn>void <a href="#setDefaultSheet"><b>setDefaultSheet</b></a> ( QStyleSheet&nbsp;*&nbsp;sheet )</div></li><li><div class=fn>QString <a href="#escape"><b>escape</b></a> ( const&nbsp;QString&nbsp;&amp;&nbsp;plain )</div></li><li><div class=fn>QString <a href="#convertFromPlainText"><b>convertFromPlainText</b></a> ( const&nbsp;QString&nbsp;&amp;&nbsp;plain, QStyleSheetItem::WhiteSpaceMode&nbsp;mode = QStyleSheetItem::WhiteSpacePre )</div></li><li><div class=fn>bool <a href="#mightBeRichText"><b>mightBeRichText</b></a> ( const&nbsp;QString&nbsp;&amp;&nbsp;text )</div></li></ul><hr><a name="details"></a><h2>Detailed Description</h2>The QStyleSheet class is a collection of styles for rich textrendering and a generator of tags.<p> <p> By creating <a href="qstylesheetitem.html">QStyleSheetItem</a> objects for a style sheet you build adefinition of a set of tags. This definition will be used by theinternal rich text rendering system to parse and display textdocuments to which the style sheet applies. Rich text is normallyvisualized in a QTextView or a <a href="qtextbrowser.html">QTextBrowser</a>. However, <a href="qlabel.html">QLabel</a>,<a href="qwhatsthis.html">QWhatsThis</a> and <a href="qmessagebox.html">QMessageBox</a> also support it, and other classes arelikely to follow. With <a href="qsimplerichtext.html">QSimpleRichText</a> it is possible to use therich text renderer for custom widgets as well.<p> 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 orimages, and other tags. In addition, rich text supports simpleHTML 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>&lt;qt&gt;</tt>...<tt>&lt;/qt&gt;</tt><td valign="top">A Qt rich text document. It understands the followingattributes:<ul><li> <tt>title</tt> -- The caption of the document. This attribute iseasily accessible with <a href="qtextedit.html#documentTitle">QTextView::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 apage of its own. Another style is <tt>detail</tt>, which can beused to explain certain expressions in more detail in afew sentences. For <tt>detail</tt>, <a href="qtextbrowser.html">QTextBrowser</a> will then keepthe current page and display the new document in a smallpopup similar to <a href="qwhatsthis.html">QWhatsThis</a>. Note that links will not workin documents with <tt>&lt;qt type="detail"&gt;...&lt;/qt&gt;</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 resolvedby a <a href="qmimesourcefactory.html">QMimeSourceFactory</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>&lt;h1&gt;...&lt;/h1&gt;</tt><td valign="top">A top-level heading.<tr bgcolor="#f0f0f0"> <td valign="top"><tt>&lt;h2&gt;...&lt;/h2&gt;</tt><td valign="top">A sublevel heading.<tr bgcolor="#d0d0d0"> <td valign="top"><tt>&lt;h3&gt;...&lt;/h3&gt;</tt><td valign="top">A sub-sublevel heading.<tr bgcolor="#f0f0f0"> <td valign="top"><tt>&lt;p&gt;...&lt;/p&gt;</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="#d0d0d0"> <td valign="top"><tt>&lt;center&gt;...</tt><br><tt>&lt;/center&gt;</tt><td valign="top">A centered paragraph.<tr bgcolor="#f0f0f0"> <td valign="top"><tt>&lt;blockquote&gt;...</tt><br><tt>&lt;/blockquote&gt;</tt><td valign="top">An indented paragraph that is useful for quotes.<tr bgcolor="#d0d0d0"> <td valign="top"><tt>&lt;ul&gt;...&lt;/ul&gt;</tt><td valign="top">An unordered list. You can also pass a type argument todefine the bullet style. The default is <tt>type=disc</tt>;other types are <tt>circle</tt> and <tt>square</tt>.<tr bgcolor="#f0f0f0"> <td valign="top"><tt>&lt;ol&gt;...&lt;/ol&gt;</tt><td valign="top">An ordered list. You can also pass a type argument todefine the enumeration label style. The default is <tt>type="1"</tt>; other types are <tt>"a"</tt> and <tt>"A"</tt>.<tr bgcolor="#d0d0d0"> <td valign="top"><tt>&lt;li&gt;...&lt;/li&gt;</tt><td valign="top">A list item. This tag can be used only within the contextof <tt>&lt;ol&gt;</tt> or <tt>&lt;ul&gt;</tt>.<tr bgcolor="#f0f0f0"> <td valign="top"><tt>&lt;pre&gt;...&lt;/pre&gt;</tt><td valign="top">For larger chunks of code. Whitespaces in the contents arepreserved. For small bits of code use the inline-style <tt>code</tt>.</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="#d0d0d0"> <td valign="top"><tt>&lt;a&gt;...&lt;/a&gt;</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>&lt;a href="target.qml"&gt;Link Text&lt;/a&gt;</tt>. Links totargets within a document are achieved in the same wayas for HTML, e.g.<br><tt>&lt;a href="target.qml#subtitle"&gt;Link Text&lt;/a&gt;</tt>.<li> A target is created by using a <a href="qobject.html#name-prop">name</a>attribute, for example<br><tt>&lt;a name="subtitle"&gt;&lt;h2&gt;Sub Title&lt;/h2&gt;&lt;/a&gt;</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="#f0f0f0"> <td valign="top"><tt>&lt;em&gt;...&lt;/em&gt;</tt><td valign="top">Emphasized. By default this is the same as <tt>&lt;i&gt;...&lt;/i&gt;</tt>(italic).<tr bgcolor="#d0d0d0"> <td valign="top"><tt>&lt;strong&gt;...&lt;/strong&gt;</tt><td valign="top">Strong. By default this is the same as <tt>&lt;b&gt;...&lt;/b&gt;</tt>(bold).<tr bgcolor="#f0f0f0"> <td valign="top"><tt>&lt;i&gt;...&lt;/i&gt;</tt><td valign="top">Italic font style.<tr bgcolor="#d0d0d0"> <td valign="top"><tt>&lt;b&gt;...&lt;/b&gt;</tt><td valign="top">Bold font style.<tr bgcolor="#f0f0f0"> <td valign="top"><tt>&lt;u&gt;...&lt;/u&gt;</tt><td valign="top">Underlined font style.<tr bgcolor="#d0d0d0"> <td valign="top"><tt>&lt;s&gt;...&lt;/s&gt;</tt><td valign="top">Strike out font style.<tr bgcolor="#f0f0f0"> <td valign="top"><tt>&lt;big&gt;...&lt;/big&gt;</tt><td valign="top">A larger font size.<tr bgcolor="#d0d0d0"> <td valign="top"><tt>&lt;small&gt;...&lt;/small&gt;</tt><td valign="top">A smaller font size.<tr bgcolor="#f0f0f0"> <td valign="top"><tt>&lt;code&gt;...&lt;/code&gt;</tt><td valign="top">Indicates code. By default this is the same as<tt>&lt;tt&gt;...&lt;/tt&gt;</tt> (typewriter). For larger junks of codeuse the block-tag <tt>&lt;</tt><tt>pre&gt;</tt>.<tr bgcolor="#d0d0d0"> <td valign="top"><tt>&lt;tt&gt;...&lt;/tt&gt;</tt><td valign="top">Typewriter font style.<tr bgcolor="#f0f0f0"> <td valign="top"><tt>&lt;font&gt;...&lt;/font&gt;</tt><td valign="top">Customizes the font size, family  and text color. The tagunderstands 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 1to 7 are supported. The value may either be absolute(for example, <tt>size=3</tt>) or relative (<tt>size=-2</tt>). Inthe latter case the sizes are simply added.<li> <tt>face</tt> -- The family of the font, for example <tt>face=times</tt>.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -