<?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="index.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 <i>alignment</i>)</li><li><div class="fn" /><b><a href="qtextoption.html#QTextOption-3">__init__</a></b> (<i>self</i>, QTextOption <i>o</i>)</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 <i>aalignment</i>)</li><li><div class="fn" /><b><a href="qtextoption.html#setFlags">setFlags</a></b> (<i>self</i>, Flags <i>aflags</i>)</li><li><div class="fn" /><b><a href="qtextoption.html#setTabArray">setTabArray</a></b> (<i>self</i>, list-of-float <i>tabStops</i>)</li><li><div class="fn" /><b><a href="qtextoption.html#setTabs">setTabs</a></b> (<i>self</i>, list-of-QTextOption.Tab <i>tabStops</i>)</li><li><div class="fn" /><b><a href="qtextoption.html#setTabStop">setTabStop</a></b> (<i>self</i>, float <i>atabStop</i>)</li><li><div class="fn" /><b><a href="qtextoption.html#setTextDirection">setTextDirection</a></b> (<i>self</i>, Qt.LayoutDirection <i>aDirection</i>)</li><li><div class="fn" /><b><a href="qtextoption.html#setUseDesignMetrics">setUseDesignMetrics</a></b> (<i>self</i>, bool <i>b</i>)</li><li><div class="fn" /><b><a href="qtextoption.html#setWrapMode">setWrapMode</a></b> (<i>self</i>, WrapMode <i>wrap</i>)</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> <hr /><h2>Type Documentation</h2><h3 class="fn"><a name="Flag-enum" />QTextOption.Flag</h3><table class="valuelist"> <tr class="odd" valign="top"> <th class="tblConst">Constant</th> <th class="tblval">Value</th> <th class="tbldscr">Description</th> </tr> <tr> <td class="topAlign"> <tt>QTextOption.IncludeTrailingSpaces</tt></td> <td class="topAlign"><tt>0x80000000</tt></td> <td class="topAlign">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 class="topAlign"><tt>QTextOption.ShowTabsAndSpaces</tt></td> <td class="topAlign"><tt>0x1</tt></td> <td class="topAlign">Visualize spaces with little dots, and tabs with little arrows.</td> </tr> <tr> <td class="topAlign"> <tt>QTextOption.ShowLineAndParagraphSeparators</tt></td> <td class="topAlign"><tt>0x2</tt></td> <td class="topAlign">Visualize line and paragraph separators with appropriate symbol characters.</td> </tr> <tr> <td class="topAlign"> <tt>QTextOption.AddSpaceForLineAndParagraphSeparators</tt></td> <td class="topAlign"><tt>0x4</tt></td> <td class="topAlign">While determining the line-break positions take into account the space added for drawing a separator character.</td> </tr> <tr> <td class="topAlign"><tt>QTextOption.SuppressColors</tt></td> <td class="topAlign"><tt>0x8</tt></td> <td class="topAlign">Suppress all color changes in the character formats (except the main selection).</td> </tr> </table> <p>The Flags type is a typedef for <a href="qflags.html">QFlags</a><Flag>. It stores an OR combination of Flag values.</p> <h3 class="fn"><a name="TabType-enum" />QTextOption.TabType</h3><p>This enum holds the different types of tabulator</p> <table class="valuelist"> <tr class="odd" valign="top"> <th class="tblConst">Constant</th> <th class="tblval">Value</th> <th class="tbldscr">Description</th> </tr> <tr> <td class="topAlign"><tt>QTextOption.LeftTab</tt></td> <td class="topAlign"><tt>0</tt></td> <td class="topAlign">A left-tab</td> </tr> <tr> <td class="topAlign"><tt>QTextOption.RightTab</tt></td> <td class="topAlign"><tt>1</tt></td> <td class="topAlign">A right-tab</td> </tr> <tr> <td class="topAlign"><tt>QTextOption.CenterTab</tt></td> <td class="topAlign"><tt>2</tt></td> <td class="topAlign">A centered-tab</td> </tr> <tr> <td class="topAlign"><tt>QTextOption.DelimiterTab</tt></td> <td class="topAlign"><tt>3</tt></td> <td class="topAlign">A tab stopping at a certain delimiter-character</td> </tr> </table> <p>This enum was introduced or modified in Qt 4.4.</p> <h3 class="fn"><a name="WrapMode-enum" />QTextOption.WrapMode</h3><p>This enum describes how text is wrapped in a document.</p> <table class="valuelist"> <tr class="odd" valign="top"> <th class="tblConst">Constant</th> <th class="tblval">Value</th> <th class="tbldscr">Description</th> </tr> <tr> <td class="topAlign"><tt>QTextOption.NoWrap</tt></td> <td class="topAlign"><tt>0</tt></td> <td class="topAlign">Text is not wrapped at all.</td> </tr> <tr> <td class="topAlign"><tt>QTextOption.WordWrap</tt></td> <td class="topAlign"><tt>1</tt></td> <td class="topAlign">Text is wrapped at word boundaries.</td> </tr> <tr> <td class="topAlign"><tt>QTextOption.ManualWrap</tt></td> <td class="topAlign"><tt>2</tt></td> <td class="topAlign">Same as QTextOption.NoWrap</td> </tr> <tr> <td class="topAlign"><tt>QTextOption.WrapAnywhere</tt></td> <td class="topAlign"><tt>3</tt></td> <td class="topAlign">Text can be wrapped at any point on a line, even if it occurs in the middle of a word.</td> </tr> <tr> <td class="topAlign"> <tt>QTextOption.WrapAtWordBoundaryOrAnywhere</tt></td> <td class="topAlign"><tt>4</tt></td> <td class="topAlign">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> <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> <i>alignment</i>)</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> <i>o</i>)</h3><p>Construct a copy of the <i>other</i> text option.</p> <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><b>See also</b> <a href="qtextoption.html#setAlignment">setAlignment</a>().</p> <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><b>See also</b> <a href="qtextoption.html#setFlags">setFlags</a>().</p> <h3 class="fn"><a name="setAlignment" />QTextOption.setAlignment (<i>self</i>, <a href="qt-alignment.html">Qt.Alignment</a> <i>aalignment</i>)</h3><p>Sets the option's text alignment to the specified <i>alignment</i>.</p> <p><b>See also</b> <a href="qtextoption.html#alignment">alignment</a>().</p> <h3 class="fn"><a name="setFlags" />QTextOption.setFlags (<i>self</i>, <a href="qtextoption-flags.html">Flags</a> <i>aflags</i>)</h3><p>Sets the flags associated with the option to the given <i>flags</i>.</p> <p><b>See also</b> <a href="qtextoption.html#flags">flags</a>().</p> <h3 class="fn"><a name="setTabArray" />QTextOption.setTabArray (<i>self</i>, list-of-float <i>tabStops</i>)</h3><p>Sets the tab positions for the text layout to those specified by <i>tabStops</i>.</p> <p><b>See also</b> <a href="qtextoption.html#tabArray">tabArray</a>(), <a href="qtextoption.html#setTabStop">setTabStop</a>(), and <a href="qtextoption.html#setTabs">setTabs</a>().</p> <h3 class="fn"><a name="setTabs" />QTextOption.setTabs (<i>self</i>, list-of-QTextOption.Tab <i>tabStops</i>)</h3><p>Set the Tab properties to <i>tabStops</i>.</p> <p><b>See also</b> <a href="qtextoption.html#tabStop">tabStop</a>() and <a href="qtextoption.html#tabs">tabs</a>().</p> <h3 class="fn"><a name="setTabStop" />QTextOption.setTabStop (<i>self</i>, float <i>atabStop</i>)</h3><p>Sets the default distance in device units between tab stops to the value specified by <i>tabStop</i>.</p> <p><b>See also</b> <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> <h3 class="fn"><a name="setTextDirection" />QTextOption.setTextDirection (<i>self</i>, <a href="qt.html#LayoutDirection-enum">Qt.LayoutDirection</a> <i>aDirection</i>)</h3><p>Sets the direction of the text layout defined by the option to the given <i>direction</i>.</p> <p><b>See also</b> <a href="qtextoption.html#textDirection">textDirection</a>().</p> <h3 class="fn"><a name="setUseDesignMetrics" />QTextOption.setUseDesignMetrics (<i>self</i>, bool <i>b</i>)</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><b>See also</b> <a href="qtextoption.html#useDesignMetrics">useDesignMetrics</a>().</p> <h3 class="fn"><a name="setWrapMode" />QTextOption.setWrapMode (<i>self</i>, <a href="qtextoption.html#WrapMode-enum">WrapMode</a> <i>wrap</i>)</h3><p>Sets the option's text wrap mode to the given <i>mode</i>.</p> <p><b>See also</b> <a href="qtextoption.html#wrapMode">wrapMode</a>().</p> <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><b>See also</b> <a href="qtextoption.html#setTabArray">setTabArray</a>() and <a href="qtextoption.html#tabStop">tabStop</a>().</p> <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><b>See also</b> <a href="qtextoption.html#tabStop">tabStop</a>(), <a href="qtextoption.html#setTabs">setTabs</a>(), and <a href="qtextoption.html#setTabStop">setTabStop</a>().</p> <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><b>See also</b> <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> <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><b>See also</b> <a href="qtextoption.html#setTextDirection">setTextDirection</a>().</p> <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><b>See also</b> <a href="qtextoption.html#setUseDesignMetrics">setUseDesignMetrics</a>().</p> <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><b>See also</b> <a href="qtextoption.html#setWrapMode">setWrapMode</a>().</p> <address><hr /><div align="center"><table border="0" cellspacing="0" width="100%"><tr class="address"><td align="left" width="25%">PyQt 4.10.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> 2012</td><td align="right" width="25%">Qt 4.8.5</td></tr></table></div></address></body></html>