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
|
<?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>QTextLength 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">QTextLength Class Reference<br /><sup><sup>[<a href="qtgui.html">QtGui</a> module]</sup></sup></h1><p>The QTextLength class encapsulates the different types of length
used in a <a href="qtextdocument.html">QTextDocument</a>. <a href="#details">More...</a></p>
<h3>Types</h3><ul><li><div class="fn" />enum <b><a href="qtextlength.html#Type-enum">Type</a></b> { VariableLength, FixedLength, PercentageLength }</li></ul><h3>Methods</h3><ul><li><div class="fn" /><b><a href="qtextlength.html#QTextLength">__init__</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qtextlength.html#QTextLength-2">__init__</a></b> (<i>self</i>, Type <i>atype</i>, float <i>avalue</i>)</li><li><div class="fn" /><b><a href="qtextlength.html#QTextLength-3">__init__</a></b> (<i>self</i>, QVariant <i>variant</i>)</li><li><div class="fn" /><b><a href="qtextlength.html#QTextLength-4">__init__</a></b> (<i>self</i>, QTextLength)</li><li><div class="fn" />float <b><a href="qtextlength.html#rawValue">rawValue</a></b> (<i>self</i>)</li><li><div class="fn" />Type <b><a href="qtextlength.html#type">type</a></b> (<i>self</i>)</li><li><div class="fn" />float <b><a href="qtextlength.html#value">value</a></b> (<i>self</i>, float <i>maximumLength</i>)</li></ul><h3>Special Methods</h3><ul><li><div class="fn" />bool <b><a href="qtextlength.html#__eq__">__eq__</a></b> (<i>self</i>, QTextLength <i>other</i>)</li><li><div class="fn" />bool <b><a href="qtextlength.html#__ne__">__ne__</a></b> (<i>self</i>, QTextLength <i>other</i>)</li></ul><a name="details" /><hr /><h2>Detailed Description</h2><p>The QTextLength class encapsulates the different types of length
used in a <a href="qtextdocument.html">QTextDocument</a>.</p>
<p>When we specify a value for the length of an element in a text
document, we often need to provide some other information so that
the length is used in the way we expect. For example, when we
specify a table width, the value can represent a fixed number of
pixels, or it can be a percentage value. This information changes
both the meaning of the value and the way it is used.</p>
<p>Generally, this class is used to specify table widths. These can
be specified either as a fixed amount of pixels, as a percentage of
the containing frame's width, or by a variable width that allows it
to take up just the space it requires.</p>
<hr /><h2>Type Documentation</h2><h3 class="fn"><a name="Type-enum" />QTextLength.Type</h3><p>This enum describes the different types a length object can
have.</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>QTextLength.VariableLength</tt></td>
<td class="topAlign"><tt>0</tt></td>
<td class="topAlign">The width of the object is variable</td>
</tr>
<tr>
<td class="topAlign"><tt>QTextLength.FixedLength</tt></td>
<td class="topAlign"><tt>1</tt></td>
<td class="topAlign">The width of the object is fixed</td>
</tr>
<tr>
<td class="topAlign"><tt>QTextLength.PercentageLength</tt></td>
<td class="topAlign"><tt>2</tt></td>
<td class="topAlign">The width of the object is in percentage of
the maximum width</td>
</tr>
</table>
<p><b>See also</b> <a href="qtextlength.html#type">type</a>().</p>
<hr /><h2>Method Documentation</h2><h3 class="fn"><a name="QTextLength" />QTextLength.__init__ (<i>self</i>)</h3><p>Constructs a new length object which represents a variable
size.</p>
<h3 class="fn"><a name="QTextLength-2" />QTextLength.__init__ (<i>self</i>, <a href="qtextlength.html#Type-enum">Type</a> <i>atype</i>, float <i>avalue</i>)</h3><p>Constructs a new length object of the given <i>type</i> and
<i>value</i>.</p>
<h3 class="fn"><a name="QTextLength-3" />QTextLength.__init__ (<i>self</i>, QVariant <i>variant</i>)</h3><h3 class="fn"><a name="QTextLength-4" />QTextLength.__init__ (<i>self</i>, <a href="qtextlength.html">QTextLength</a>)</h3><h3 class="fn"><a name="rawValue" />float QTextLength.rawValue (<i>self</i>)</h3><p>Returns the constraint value that is specific for the type of
the length. If the length is <a href="qtextlength.html#Type-enum">QTextLength.PercentageLength</a> then
the raw value is in percent, in the range of 0 to 100. If the
length is <a href="qtextlength.html#Type-enum">QTextLength.FixedLength</a> then that
fixed amount is returned. For variable lengths, zero is
returned.</p>
<h3 class="fn"><a name="type" /><a href="qtextlength.html#Type-enum">Type</a> QTextLength.type (<i>self</i>)</h3><p>Returns the type of this length object.</p>
<p><b>See also</b> <a href="qtextlength.html#Type-enum">QTextLength.Type</a>.</p>
<h3 class="fn"><a name="value" />float QTextLength.value (<i>self</i>, float <i>maximumLength</i>)</h3><p>Returns the effective length, constrained by the type of the
length object and the specified <i>maximumLength</i>.</p>
<p><b>See also</b> <a href="qtextlength.html#type">type</a>().</p>
<h3 class="fn"><a name="__eq__" />bool QTextLength.__eq__ (<i>self</i>, <a href="qtextlength.html">QTextLength</a> <i>other</i>)</h3><h3 class="fn"><a name="__ne__" />bool QTextLength.__ne__ (<i>self</i>, <a href="qtextlength.html">QTextLength</a> <i>other</i>)</h3><address><hr /><div align="center"><table border="0" cellspacing="0" width="100%"><tr class="address"><td align="left" width="25%">PyQt 4.12.1 for X11</td><td align="center" width="50%">Copyright © <a href="http://www.riverbankcomputing.com">Riverbank Computing Ltd</a> and <a href="http://www.qt.io">The Qt Company</a> 2015</td><td align="right" width="25%">Qt 4.8.7</td></tr></table></div></address></body></html>
|