1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104
|
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
<html><head><title>QTextOption Class Reference</title><style>h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm }
a:link { color: #004faf; text-decoration: none }
a:visited { color: #672967; text-decoration: none }
td.postheader { font-family: sans-serif }
tr.address { font-family: sans-serif }
body { background: #ffffff; color: black; }
</style></head><body><table border="0" cellpadding="0" cellspacing="0" width="100%"><tr /><td align="left" valign="top" width="32"><img align="left" border="0" height="32" src="images/rb-logo.png" width="32" /></td><td width="1">  </td><td class="postheader" valign="center"><a href="../pyqt4ref.html"><font color="#004faf">Home</font></a> · <a href="classes.html"><font color="#004faf">All Classes</font></a> · <a href="modules.html"><font color="#004faf">Modules</font></a></td></table><h1 align="center">QTextOption Class Reference<br /><sup><sup>[<a href="qtgui.html">QtGui</a> module]</sup></sup></h1><p>The QTextOption class provides a description of general rich text properties. <a href="#details">More...</a></p>
<h3>Types</h3><ul><li><div class="fn" />enum <b><a href="qtextoption.html#Flag-enum">Flag</a></b> { IncludeTrailingSpaces, ShowTabsAndSpaces, ShowLineAndParagraphSeparators, AddSpaceForLineAndParagraphSeparators, SuppressColors }</li><li><div class="fn" />class <b><a href="qtextoption-flags.html">Flags</a></b></li><li><div class="fn" />class <b><a href="qtextoption-tab.html">Tab</a></b></li><li><div class="fn" />enum <b><a href="qtextoption.html#TabType-enum">TabType</a></b> { LeftTab, RightTab, CenterTab, DelimiterTab }</li><li><div class="fn" />enum <b><a href="qtextoption.html#WrapMode-enum">WrapMode</a></b> { NoWrap, WordWrap, ManualWrap, WrapAnywhere, WrapAtWordBoundaryOrAnywhere }</li></ul><h3>Methods</h3><ul><li><div class="fn" /><b><a href="qtextoption.html#QTextOption">__init__</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qtextoption.html#QTextOption-2">__init__</a></b> (<i>self</i>, Qt.Alignment)</li><li><div class="fn" /><b><a href="qtextoption.html#QTextOption-3">__init__</a></b> (<i>self</i>, QTextOption)</li><li><div class="fn" />Qt.Alignment <b><a href="qtextoption.html#alignment">alignment</a></b> (<i>self</i>)</li><li><div class="fn" />Flags <b><a href="qtextoption.html#flags">flags</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qtextoption.html#setAlignment">setAlignment</a></b> (<i>self</i>, Qt.Alignment)</li><li><div class="fn" /><b><a href="qtextoption.html#setFlags">setFlags</a></b> (<i>self</i>, Flags)</li><li><div class="fn" /><b><a href="qtextoption.html#setTabArray">setTabArray</a></b> (<i>self</i>, list-of-float)</li><li><div class="fn" /><b><a href="qtextoption.html#setTabs">setTabs</a></b> (<i>self</i>, list-of-QTextOption.Tab)</li><li><div class="fn" /><b><a href="qtextoption.html#setTabStop">setTabStop</a></b> (<i>self</i>, float)</li><li><div class="fn" /><b><a href="qtextoption.html#setTextDirection">setTextDirection</a></b> (<i>self</i>, Qt.LayoutDirection)</li><li><div class="fn" /><b><a href="qtextoption.html#setUseDesignMetrics">setUseDesignMetrics</a></b> (<i>self</i>, bool)</li><li><div class="fn" /><b><a href="qtextoption.html#setWrapMode">setWrapMode</a></b> (<i>self</i>, WrapMode)</li><li><div class="fn" />list-of-float <b><a href="qtextoption.html#tabArray">tabArray</a></b> (<i>self</i>)</li><li><div class="fn" />list-of-QTextOption.Tab <b><a href="qtextoption.html#tabs">tabs</a></b> (<i>self</i>)</li><li><div class="fn" />float <b><a href="qtextoption.html#tabStop">tabStop</a></b> (<i>self</i>)</li><li><div class="fn" />Qt.LayoutDirection <b><a href="qtextoption.html#textDirection">textDirection</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qtextoption.html#useDesignMetrics">useDesignMetrics</a></b> (<i>self</i>)</li><li><div class="fn" />WrapMode <b><a href="qtextoption.html#wrapMode">wrapMode</a></b> (<i>self</i>)</li></ul><a name="details" /><hr /><h2>Detailed Description</h2><p>The QTextOption class provides a description of general rich text properties.</p>
<p>QTextOption is used to encapsulate common rich text properties in a single object. It contains information about text alignment, layout direction, word wrapping, and other standard properties associated with text rendering and layout.</p>
<p>See also <a href="qtextedit.html">QTextEdit</a>, <a href="qtextdocument.html">QTextDocument</a>, and <a href="qtextcursor.html">QTextCursor</a>.</p>
<hr /><h2>Type Documentation</h2><h3 class="fn"><a name="Flag-enum" />QTextOption.Flag</h3><p><table border="1" cellpadding="2" cellspacing="1" class="valuelist" width="100%">
<tr><th width="25%">Constant</th><th width="15%">Value</th><th width="60%">Description</th></tr>
<tr><td valign="top"><tt>QTextOption.IncludeTrailingSpaces</tt></td><td align="center" valign="top"><tt>0x80000000</tt></td><td valign="top">When this option is set, <a href="qtextline.html#naturalTextWidth">QTextLine.naturalTextWidth</a>() and naturalTextRect() will return a value that includes the width of trailing spaces in the text; otherwise this width is excluded.</td></tr>
<tr><td valign="top"><tt>QTextOption.ShowTabsAndSpaces</tt></td><td align="center" valign="top"><tt>0x1</tt></td><td valign="top">Visualize spaces with little dots, and tabs with little arrows.</td></tr>
<tr><td valign="top"><tt>QTextOption.ShowLineAndParagraphSeparators</tt></td><td align="center" valign="top"><tt>0x2</tt></td><td valign="top">Visualize line and paragraph separators with appropriate symbol characters.</td></tr>
<tr><td valign="top"><tt>QTextOption.AddSpaceForLineAndParagraphSeparators</tt></td><td align="center" valign="top"><tt>0x4</tt></td><td valign="top">While determining the line-break positions take into account the space added for drawing a separator character.</td></tr>
<tr><td valign="top"><tt>QTextOption.SuppressColors</tt></td><td align="center" valign="top"><tt>0x8</tt></td><td valign="top">Suppress all color changes in the character formats (except the main selection).</td></tr>
</table></p>
<p>The Flags type is a typedef for <a href="qflags.html">QFlags</a><Flag>. It stores an OR combination of Flag values.</p>
<a name="//apple_ref/cpp/tag/QTextOption/TabType" />
<a name="//apple_ref/cpp/econst/QTextOption/LeftTab" />
<a name="//apple_ref/cpp/econst/QTextOption/RightTab" />
<a name="//apple_ref/cpp/econst/QTextOption/CenterTab" />
<a name="//apple_ref/cpp/econst/QTextOption/DelimiterTab" />
<h3 class="fn"><a name="TabType-enum" />QTextOption.TabType</h3><p>This enum holds the different types of tabulator</p>
<p><table border="1" cellpadding="2" cellspacing="1" class="valuelist" width="100%">
<tr><th width="25%">Constant</th><th width="15%">Value</th><th width="60%">Description</th></tr>
<tr><td valign="top"><tt>QTextOption.LeftTab</tt></td><td align="center" valign="top"><tt>0</tt></td><td valign="top">A left-tab</td></tr>
<tr><td valign="top"><tt>QTextOption.RightTab</tt></td><td align="center" valign="top"><tt>1</tt></td><td valign="top">A right-tab</td></tr>
<tr><td valign="top"><tt>QTextOption.CenterTab</tt></td><td align="center" valign="top"><tt>2</tt></td><td valign="top">A centered-tab</td></tr>
<tr><td valign="top"><tt>QTextOption.DelimiterTab</tt></td><td align="center" valign="top"><tt>3</tt></td><td valign="top">A tab stopping at a certain delimiter-character</td></tr>
</table></p>
<p>This enum was introduced in Qt 4.4.</p>
<a name="//apple_ref/cpp/tag/QTextOption/WrapMode" />
<a name="//apple_ref/cpp/econst/QTextOption/NoWrap" />
<a name="//apple_ref/cpp/econst/QTextOption/WordWrap" />
<a name="//apple_ref/cpp/econst/QTextOption/ManualWrap" />
<a name="//apple_ref/cpp/econst/QTextOption/WrapAnywhere" />
<a name="//apple_ref/cpp/econst/QTextOption/WrapAtWordBoundaryOrAnywhere" />
<h3 class="fn"><a name="WrapMode-enum" />QTextOption.WrapMode</h3><p>This enum describes how text is wrapped in a document.</p>
<p><table border="1" cellpadding="2" cellspacing="1" class="valuelist" width="100%">
<tr><th width="25%">Constant</th><th width="15%">Value</th><th width="60%">Description</th></tr>
<tr><td valign="top"><tt>QTextOption.NoWrap</tt></td><td align="center" valign="top"><tt>0</tt></td><td valign="top">Text is not wrapped at all.</td></tr>
<tr><td valign="top"><tt>QTextOption.WordWrap</tt></td><td align="center" valign="top"><tt>1</tt></td><td valign="top">Text is wrapped at word boundaries.</td></tr>
<tr><td valign="top"><tt>QTextOption.ManualWrap</tt></td><td align="center" valign="top"><tt>2</tt></td><td valign="top">Same as QTextOption.NoWrap</td></tr>
<tr><td valign="top"><tt>QTextOption.WrapAnywhere</tt></td><td align="center" valign="top"><tt>3</tt></td><td valign="top">Text can be wrapped at any point on a line, even if it occurs in the middle of a word.</td></tr>
<tr><td valign="top"><tt>QTextOption.WrapAtWordBoundaryOrAnywhere</tt></td><td align="center" valign="top"><tt>4</tt></td><td valign="top">If possible, wrapping occurs at a word boundary; otherwise it will occur at the appropriate point on the line, even in the middle of a word.</td></tr>
</table></p>
<hr /><h2>Method Documentation</h2><h3 class="fn"><a name="QTextOption" />QTextOption.__init__ (<i>self</i>)</h3><p>Constructs a text option with default properties for text. The text alignment property is set to <a href="qt.html#AlignmentFlag-enum">Qt.AlignLeft</a>. The word wrap property is set to <a href="qtextoption.html#WrapMode-enum">QTextOption.WordWrap</a>. The using of design metrics flag is set to false.</p>
<h3 class="fn"><a name="QTextOption-2" />QTextOption.__init__ (<i>self</i>, <a href="qt-alignment.html">Qt.Alignment</a>)</h3><p>Constructs a text option with the given <i>alignment</i> for text. The word wrap property is set to <a href="qtextoption.html#WrapMode-enum">QTextOption.WordWrap</a>. The using of design metrics flag is set to false.</p>
<h3 class="fn"><a name="QTextOption-3" />QTextOption.__init__ (<i>self</i>, <a href="qtextoption.html">QTextOption</a>)</h3><p>Construct a copy of the <i>other</i> text option.</p>
<a name="//apple_ref/cpp/instm/QTextOption/~QTextOption" />
<h3 class="fn"><a name="alignment" /><a href="qt-alignment.html">Qt.Alignment</a> QTextOption.alignment (<i>self</i>)</h3><p>Returns the text alignment defined by the option.</p>
<p>See also <a href="qtextoption.html#setAlignment">setAlignment</a>().</p>
<a name="//apple_ref/cpp/instm/QTextOption/flags" />
<h3 class="fn"><a name="flags" /><a href="qtextoption-flags.html">Flags</a> QTextOption.flags (<i>self</i>)</h3><p>Returns the flags associated with the option.</p>
<p>See also <a href="qtextoption.html#setFlags">setFlags</a>().</p>
<a name="//apple_ref/cpp/instm/QTextOption/setAlignment" />
<h3 class="fn"><a name="setAlignment" />QTextOption.setAlignment (<i>self</i>, <a href="qt-alignment.html">Qt.Alignment</a>)</h3><p>Sets the option's text alignment to the specified <i>alignment</i>.</p>
<p>See also <a href="qtextoption.html#alignment">alignment</a>().</p>
<a name="//apple_ref/cpp/instm/QTextOption/setFlags" />
<h3 class="fn"><a name="setFlags" />QTextOption.setFlags (<i>self</i>, <a href="qtextoption-flags.html">Flags</a>)</h3><p>Sets the flags associated with the option to the given <i>flags</i>.</p>
<p>See also <a href="qtextoption.html#flags">flags</a>().</p>
<a name="//apple_ref/cpp/instm/QTextOption/setTabArray" />
<h3 class="fn"><a name="setTabArray" />QTextOption.setTabArray (<i>self</i>, list-of-float)</h3><p>Sets the tab positions for the text layout to those specified by <i>tabStops</i>.</p>
<p>See also <a href="qtextoption.html#tabArray">tabArray</a>(), <a href="qtextoption.html#setTabStop">setTabStop</a>(), and <a href="qtextoption.html#setTabs">setTabs</a>().</p>
<a name="//apple_ref/cpp/instm/QTextOption/setTabStop" />
<h3 class="fn"><a name="setTabs" />QTextOption.setTabs (<i>self</i>, list-of-QTextOption.Tab)</h3><p>Set the Tab properties to <i>tabStops</i>.</p>
<p>See also <a href="qtextoption.html#tabStop">tabStop</a>() and <a href="qtextoption.html#tabs">tabs</a>().</p>
<a name="//apple_ref/cpp/instm/QTextOption/setTextDirection" />
<h3 class="fn"><a name="setTabStop" />QTextOption.setTabStop (<i>self</i>, float)</h3><p>Sets the default distance in device units between tab stops to the value specified by <i>tabStop</i>.</p>
<p>See also <a href="qtextoption.html#tabStop">tabStop</a>(), <a href="qtextoption.html#setTabArray">setTabArray</a>(), <a href="qtextoption.html#setTabs">setTabs</a>(), and <a href="qtextoption.html#tabs">tabs</a>().</p>
<a name="//apple_ref/cpp/instm/QTextOption/setTabs" />
<h3 class="fn"><a name="setTextDirection" />QTextOption.setTextDirection (<i>self</i>, <a href="qt.html#LayoutDirection-enum">Qt.LayoutDirection</a>)</h3><p>Sets the direction of the text layout defined by the option to the given <i>direction</i>.</p>
<p>See also <a href="qtextoption.html#textDirection">textDirection</a>().</p>
<a name="//apple_ref/cpp/instm/QTextOption/setUseDesignMetrics" />
<h3 class="fn"><a name="setUseDesignMetrics" />QTextOption.setUseDesignMetrics (<i>self</i>, bool)</h3><p>If <i>enable</i> is true then the layout will use design metrics; otherwise it will use the metrics of the paint device (which is the default behavior).</p>
<p>See also <a href="qtextoption.html#useDesignMetrics">useDesignMetrics</a>().</p>
<a name="//apple_ref/cpp/instm/QTextOption/setWrapMode" />
<h3 class="fn"><a name="setWrapMode" />QTextOption.setWrapMode (<i>self</i>, <a href="qtextoption.html#WrapMode-enum">WrapMode</a>)</h3><p>Sets the option's text wrap mode to the given <i>mode</i>.</p>
<p>See also <a href="qtextoption.html#wrapMode">wrapMode</a>().</p>
<a name="//apple_ref/cpp/instm/QTextOption/tabArray" />
<h3 class="fn"><a name="tabArray" />list-of-float QTextOption.tabArray (<i>self</i>)</h3><p>Returns a list of tab positions defined for the text layout.</p>
<p>See also <a href="qtextoption.html#setTabArray">setTabArray</a>() and <a href="qtextoption.html#tabStop">tabStop</a>().</p>
<a name="//apple_ref/cpp/instm/QTextOption/tabStop" />
<h3 class="fn"><a name="tabs" />list-of-QTextOption.Tab QTextOption.tabs (<i>self</i>)</h3><p>Returns a list of tab positions defined for the text layout.</p>
<p>This function was introduced in Qt 4.4.</p>
<p>See also <a href="qtextoption.html#tabStop">tabStop</a>(), <a href="qtextoption.html#setTabs">setTabs</a>(), and <a href="qtextoption.html#setTabStop">setTabStop</a>().</p>
<a name="//apple_ref/cpp/instm/QTextOption/textDirection" />
<h3 class="fn"><a name="tabStop" />float QTextOption.tabStop (<i>self</i>)</h3><p>Returns the distance in device units between tab stops. Convenient function for the above method</p>
<p>See also <a href="qtextoption.html#setTabStop">setTabStop</a>(), <a href="qtextoption.html#tabArray">tabArray</a>(), <a href="qtextoption.html#setTabs">setTabs</a>(), and <a href="qtextoption.html#tabs">tabs</a>().</p>
<a name="//apple_ref/cpp/instm/QTextOption/tabs" />
<h3 class="fn"><a name="textDirection" /><a href="qt.html#LayoutDirection-enum">Qt.LayoutDirection</a> QTextOption.textDirection (<i>self</i>)</h3><p>Returns the direction of the text layout defined by the option.</p>
<p>See also <a href="qtextoption.html#setTextDirection">setTextDirection</a>().</p>
<a name="//apple_ref/cpp/instm/QTextOption/useDesignMetrics" />
<h3 class="fn"><a name="useDesignMetrics" />bool QTextOption.useDesignMetrics (<i>self</i>)</h3><p>Returns true if the layout uses design rather than device metrics; otherwise returns false.</p>
<p>See also <a href="qtextoption.html#setUseDesignMetrics">setUseDesignMetrics</a>().</p>
<a name="//apple_ref/cpp/instm/QTextOption/wrapMode" />
<h3 class="fn"><a name="wrapMode" /><a href="qtextoption.html#WrapMode-enum">WrapMode</a> QTextOption.wrapMode (<i>self</i>)</h3><p>Returns the text wrap mode defined by the option.</p>
<p>See also <a href="qtextoption.html#setWrapMode">setWrapMode</a>().</p>
<a name="//apple_ref/cpp/instm/QTextOption/operator=" />
<address><hr /><div align="center"><table border="0" cellspacing="0" width="100%"><tr class="address"><td align="left" width="25%">PyQt 4.7.3 for X11</td><td align="center" width="50%">Copyright © <a href="http://www.riverbankcomputing.com">Riverbank Computing Ltd</a> and <a href="http://www.qtsoftware.com">Nokia</a> 2010</td><td align="right" width="25%">Qt 4.6.2</td></tr></table></div></address></body></html>
|