Sophie

Sophie

distrib > Mageia > 4 > i586 > by-pkgid > 28b9e36e96ce34b2567ae5b47a27b2c5 > files > 1000

python-qt4-doc-4.10.3-3.mga4.noarch.rpm

<?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>QSize 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">&#160;&#160;</td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a>&#160;&#183; <a href="classes.html"><font color="#004faf">All Classes</font></a>&#160;&#183; <a href="modules.html"><font color="#004faf">Modules</font></a></td></table><h1 align="center">QSize Class Reference<br /><sup><sup>[<a href="qtcore.html">QtCore</a> module]</sup></sup></h1><p>The QSize class defines the size of a two-dimensional object
using integer point precision. <a href="#details">More...</a></p>

<h3>Methods</h3><ul><li><div class="fn" /><b><a href="qsize.html#QSize">__init__</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qsize.html#QSize-2">__init__</a></b> (<i>self</i>, int&#160;<i>w</i>, int&#160;<i>h</i>)</li><li><div class="fn" /><b><a href="qsize.html#QSize-3">__init__</a></b> (<i>self</i>, QSize)</li><li><div class="fn" />QSize <b><a href="qsize.html#boundedTo">boundedTo</a></b> (<i>self</i>, QSize&#160;<i>otherSize</i>)</li><li><div class="fn" />QSize <b><a href="qsize.html#expandedTo">expandedTo</a></b> (<i>self</i>, QSize&#160;<i>otherSize</i>)</li><li><div class="fn" />int <b><a href="qsize.html#height">height</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qsize.html#isEmpty">isEmpty</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qsize.html#isNull">isNull</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qsize.html#isValid">isValid</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qsize.html#scale">scale</a></b> (<i>self</i>, QSize&#160;<i>s</i>, Qt.AspectRatioMode&#160;<i>mode</i>)</li><li><div class="fn" /><b><a href="qsize.html#scale-2">scale</a></b> (<i>self</i>, int&#160;<i>w</i>, int&#160;<i>h</i>, Qt.AspectRatioMode&#160;<i>mode</i>)</li><li><div class="fn" /><b><a href="qsize.html#setHeight">setHeight</a></b> (<i>self</i>, int&#160;<i>h</i>)</li><li><div class="fn" /><b><a href="qsize.html#setWidth">setWidth</a></b> (<i>self</i>, int&#160;<i>w</i>)</li><li><div class="fn" /><b><a href="qsize.html#transpose">transpose</a></b> (<i>self</i>)</li><li><div class="fn" />int <b><a href="qsize.html#width">width</a></b> (<i>self</i>)</li></ul><h3>Special Methods</h3><ul><li><div class="fn" />QSize <b><a href="qsize.html#__add__">__add__</a></b> (<i>self</i>, QSize&#160;<i>s2</i>)</li><li><div class="fn" />int <b><a href="qsize.html#__bool__">__bool__</a></b> (<i>self</i>)</li><li><div class="fn" />QSize <b><a href="qsize.html#__div__">__div__</a></b> (<i>self</i>, float&#160;<i>c</i>)</li><li><div class="fn" />bool <b><a href="qsize.html#__eq__">__eq__</a></b> (<i>self</i>, QSize&#160;<i>s2</i>)</li><li><div class="fn" />QSize <b><a href="qsize.html#__iadd__">__iadd__</a></b> (<i>self</i>, QSize&#160;<i>s</i>)</li><li><div class="fn" />QSize <b><a href="qsize.html#__idiv__">__idiv__</a></b> (<i>self</i>, float&#160;<i>c</i>)</li><li><div class="fn" />QSize <b><a href="qsize.html#__imul__">__imul__</a></b> (<i>self</i>, float&#160;<i>c</i>)</li><li><div class="fn" />QSize <b><a href="qsize.html#__isub__">__isub__</a></b> (<i>self</i>, QSize&#160;<i>s</i>)</li><li><div class="fn" />QSize <b><a href="qsize.html#__mul__">__mul__</a></b> (<i>self</i>, float&#160;<i>c</i>)</li><li><div class="fn" />QSize <b><a href="qsize.html#__mul__-2">__mul__</a></b> (<i>self</i>, QSize&#160;<i>s</i>)</li><li><div class="fn" />bool <b><a href="qsize.html#__ne__">__ne__</a></b> (<i>self</i>, QSize&#160;<i>s2</i>)</li><li><div class="fn" />str <b><a href="qsize.html#__repr__">__repr__</a></b> (<i>self</i>)</li><li><div class="fn" />QSize <b><a href="qsize.html#__sub__">__sub__</a></b> (<i>self</i>, QSize&#160;<i>s2</i>)</li></ul><a name="details" /><hr /><h2>Detailed Description</h2><p>This class can be pickled.</p><p>The QSize class defines the size of a two-dimensional object
using integer point precision.</p>
<p>A size is specified by a <a href="qsize.html#width">width</a>()
and a <a href="qsize.html#height">height</a>(). It can be set in
the constructor and changed using the <a href="qsize.html#setWidth">setWidth</a>(), <a href="qsize.html#setHeight">setHeight</a>(), or <a href="qsize.html#scale">scale</a>() functions, or using arithmetic
operators. A size can also be manipulated directly by retrieving
references to the width and height using the <a href="qsize.html#rwidth">rwidth</a>() and <a href="qsize.html#rheight">rheight</a>() functions. Finally, the width
and height can be swapped using the <a href="qsize.html#transpose">transpose</a>() function.</p>
<p>The <a href="qsize.html#isValid">isValid</a>() function
determines if a size is valid (a valid size has both width and
height greater than zero). The <a href="qsize.html#isEmpty">isEmpty</a>() function returns true if either
of the width and height is less than, or equal to, zero, while the
<a href="qsize.html#isNull">isNull</a>() function returns true only
if both the width and the height is zero.</p>
<p>Use the <a href="qsize.html#expandedTo">expandedTo</a>()
function to retrieve a size which holds the maximum height and
width of <i>this</i> size and a given size. Similarly, the <a href="qsize.html#boundedTo">boundedTo</a>() function returns a size
which holds the minimum height and width of <i>this</i> size and a
given size.</p>
<p>QSize objects can be streamed as well as compared.</p>
<hr /><h2>Method Documentation</h2><h3 class="fn"><a name="QSize" />QSize.__init__ (<i>self</i>)</h3><p>Constructs a size with an invalid width and height (i.e.,
<a href="qsize.html#isValid">isValid</a>() returns false).</p>
<p><b>See also</b> <a href="qsize.html#isValid">isValid</a>().</p>


<h3 class="fn"><a name="QSize-2" />QSize.__init__ (<i>self</i>, int&#160;<i>w</i>, int&#160;<i>h</i>)</h3><p>Constructs a size with the given <i>width</i> and
<i>height</i>.</p>
<p><b>See also</b> <a href="qsize.html#setWidth">setWidth</a>() and
<a href="qsize.html#setHeight">setHeight</a>().</p>


<h3 class="fn"><a name="QSize-3" />QSize.__init__ (<i>self</i>, <a href="qsize.html">QSize</a>)</h3><h3 class="fn"><a name="boundedTo" /><a href="qsize.html">QSize</a> QSize.boundedTo (<i>self</i>, <a href="qsize.html">QSize</a>&#160;<i>otherSize</i>)</h3><p>Returns a size holding the minimum width and height of this size
and the given <i>otherSize</i>.</p>
<p><b>See also</b> <a href="qsize.html#expandedTo">expandedTo</a>()
and <a href="qsize.html#scale">scale</a>().</p>


<h3 class="fn"><a name="expandedTo" /><a href="qsize.html">QSize</a> QSize.expandedTo (<i>self</i>, <a href="qsize.html">QSize</a>&#160;<i>otherSize</i>)</h3><p>Returns a size holding the maximum width and height of this size
and the given <i>otherSize</i>.</p>
<p><b>See also</b> <a href="qsize.html#boundedTo">boundedTo</a>()
and <a href="qsize.html#scale">scale</a>().</p>


<h3 class="fn"><a name="height" />int QSize.height (<i>self</i>)</h3><p>Returns the height.</p>
<p><b>See also</b> <a href="qsize.html#width">width</a>() and
<a href="qsize.html#setHeight">setHeight</a>().</p>


<h3 class="fn"><a name="isEmpty" />bool QSize.isEmpty (<i>self</i>)</h3><p>Returns true if either of the width and height is less than or
equal to 0; otherwise returns false.</p>
<p><b>See also</b> <a href="qsize.html#isNull">isNull</a>() and
<a href="qsize.html#isValid">isValid</a>().</p>


<h3 class="fn"><a name="isNull" />bool QSize.isNull (<i>self</i>)</h3><p>Returns true if both the width and height is 0; otherwise
returns false.</p>
<p><b>See also</b> <a href="qsize.html#isValid">isValid</a>() and
<a href="qsize.html#isEmpty">isEmpty</a>().</p>


<h3 class="fn"><a name="isValid" />bool QSize.isValid (<i>self</i>)</h3><p>Returns true if both the width and height is equal to or greater
than 0; otherwise returns false.</p>
<p><b>See also</b> <a href="qsize.html#isNull">isNull</a>() and
<a href="qsize.html#isEmpty">isEmpty</a>().</p>


<h3 class="fn"><a name="scale" />QSize.scale (<i>self</i>, <a href="qsize.html">QSize</a>&#160;<i>s</i>, <a href="qt.html#AspectRatioMode-enum">Qt.AspectRatioMode</a>&#160;<i>mode</i>)</h3><p>Scales the size to a rectangle with the given <i>width</i> and
<i>height</i>, according to the specified <i>mode</i>:</p>
<ul>
<li>If <i>mode</i> is <a href="qt.html#AspectRatioMode-enum">Qt.IgnoreAspectRatio</a>, the size
is set to (<i>width</i>, <i>height</i>).</li>
<li>If <i>mode</i> is <a href="qt.html#AspectRatioMode-enum">Qt.KeepAspectRatio</a>, the current
size is scaled to a rectangle as large as possible inside
(<i>width</i>, <i>height</i>), preserving the aspect ratio.</li>
<li>If <i>mode</i> is <a href="qt.html#AspectRatioMode-enum">Qt.KeepAspectRatioByExpanding</a>,
the current size is scaled to a rectangle as small as possible
outside (<i>width</i>, <i>height</i>), preserving the aspect
ratio.</li>
</ul>
<p>Example:</p>
<pre class="cpp">
 <span class="type"><a href="qsize.html">QSize</a></span> t1(<span class="number">10</span><span class="operator">,</span> <span class="number">12</span>);
 t1<span class="operator">.</span>scale(<span class="number">60</span><span class="operator">,</span> <span class="number">60</span><span class="operator">,</span> <span class="type"><a href="qt.html">Qt</a></span><span class="operator">.</span>IgnoreAspectRatio);
 <span class="comment">// t1 is (60, 60)</span>

 <span class="type"><a href="qsize.html">QSize</a></span> t2(<span class="number">10</span><span class="operator">,</span> <span class="number">12</span>);
 t2<span class="operator">.</span>scale(<span class="number">60</span><span class="operator">,</span> <span class="number">60</span><span class="operator">,</span> <span class="type"><a href="qt.html">Qt</a></span><span class="operator">.</span>KeepAspectRatio);
 <span class="comment">// t2 is (50, 60)</span>

 <span class="type"><a href="qsize.html">QSize</a></span> t3(<span class="number">10</span><span class="operator">,</span> <span class="number">12</span>);
 t3<span class="operator">.</span>scale(<span class="number">60</span><span class="operator">,</span> <span class="number">60</span><span class="operator">,</span> <span class="type"><a href="qt.html">Qt</a></span><span class="operator">.</span>KeepAspectRatioByExpanding);
 <span class="comment">// t3 is (60, 72)</span>
</pre>
<p><b>See also</b> <a href="qsize.html#setWidth">setWidth</a>() and
<a href="qsize.html#setHeight">setHeight</a>().</p>


<h3 class="fn"><a name="scale-2" />QSize.scale (<i>self</i>, int&#160;<i>w</i>, int&#160;<i>h</i>, <a href="qt.html#AspectRatioMode-enum">Qt.AspectRatioMode</a>&#160;<i>mode</i>)</h3><p>This is an overloaded function.</p>
<p>Scales the size to a rectangle with the given <i>size</i>,
according to the specified <i>mode</i>.</p>


<h3 class="fn"><a name="setHeight" />QSize.setHeight (<i>self</i>, int&#160;<i>h</i>)</h3><p>Sets the height to the given <i>height</i>.</p>
<p><b>See also</b> <a href="qsize.html#rheight">rheight</a>(),
<a href="qsize.html#height">height</a>(), and <a href="qsize.html#setWidth">setWidth</a>().</p>


<h3 class="fn"><a name="setWidth" />QSize.setWidth (<i>self</i>, int&#160;<i>w</i>)</h3><p>Sets the width to the given <i>width</i>.</p>
<p><b>See also</b> <a href="qsize.html#rwidth">rwidth</a>(),
<a href="qsize.html#width">width</a>(), and <a href="qsize.html#setHeight">setHeight</a>().</p>


<h3 class="fn"><a name="transpose" />QSize.transpose (<i>self</i>)</h3><p>Swaps the width and height values.</p>
<p><b>See also</b> <a href="qsize.html#setWidth">setWidth</a>() and
<a href="qsize.html#setHeight">setHeight</a>().</p>


<h3 class="fn"><a name="width" />int QSize.width (<i>self</i>)</h3><p>Returns the width.</p>
<p><b>See also</b> <a href="qsize.html#height">height</a>() and
<a href="qsize.html#setWidth">setWidth</a>().</p>


<h3 class="fn"><a name="__add__" /><a href="qsize.html">QSize</a> QSize.__add__ (<i>self</i>, <a href="qsize.html">QSize</a>&#160;<i>s2</i>)</h3><h3 class="fn"><a name="__bool__" />int QSize.__bool__ (<i>self</i>)</h3><h3 class="fn"><a name="__div__" /><a href="qsize.html">QSize</a> QSize.__div__ (<i>self</i>, float&#160;<i>c</i>)</h3><h3 class="fn"><a name="__eq__" />bool QSize.__eq__ (<i>self</i>, <a href="qsize.html">QSize</a>&#160;<i>s2</i>)</h3><h3 class="fn"><a name="__iadd__" /><a href="qsize.html">QSize</a> QSize.__iadd__ (<i>self</i>, <a href="qsize.html">QSize</a>&#160;<i>s</i>)</h3><h3 class="fn"><a name="__idiv__" /><a href="qsize.html">QSize</a> QSize.__idiv__ (<i>self</i>, float&#160;<i>c</i>)</h3><h3 class="fn"><a name="__imul__" /><a href="qsize.html">QSize</a> QSize.__imul__ (<i>self</i>, float&#160;<i>c</i>)</h3><h3 class="fn"><a name="__isub__" /><a href="qsize.html">QSize</a> QSize.__isub__ (<i>self</i>, <a href="qsize.html">QSize</a>&#160;<i>s</i>)</h3><h3 class="fn"><a name="__mul__" /><a href="qsize.html">QSize</a> QSize.__mul__ (<i>self</i>, float&#160;<i>c</i>)</h3><h3 class="fn"><a name="__mul__-2" /><a href="qsize.html">QSize</a> QSize.__mul__ (<i>self</i>, <a href="qsize.html">QSize</a>&#160;<i>s</i>)</h3><h3 class="fn"><a name="__ne__" />bool QSize.__ne__ (<i>self</i>, <a href="qsize.html">QSize</a>&#160;<i>s2</i>)</h3><h3 class="fn"><a name="__repr__" />str QSize.__repr__ (<i>self</i>)</h3><h3 class="fn"><a name="__sub__" /><a href="qsize.html">QSize</a> QSize.__sub__ (<i>self</i>, <a href="qsize.html">QSize</a>&#160;<i>s2</i>)</h3><address><hr /><div align="center"><table border="0" cellspacing="0" width="100%"><tr class="address"><td align="left" width="25%">PyQt&#160;4.10.3 for X11</td><td align="center" width="50%">Copyright &#169; <a href="http://www.riverbankcomputing.com">Riverbank&#160;Computing&#160;Ltd</a> and <a href="http://www.qtsoftware.com">Nokia</a> 2012</td><td align="right" width="25%">Qt&#160;4.8.5</td></tr></table></div></address></body></html>