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 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Qt Toolkit - QSize 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: white; color: black; }
--></style>
</head><body bgcolor="#ffffff">
<table width="100%">
<tr><td><a href="index.html">
<img width="100" height="100" src="qtlogo.png"
alt="Home" border="0"><img width="100"
height="100" src="face.png" alt="Home" border="0">
</a><td valign=top><div align=right><img src="dochead.png" width="472" height="27"><br>
<a href="classes.html"><b>Classes</b></a>
-<a href="annotated.html">Annotated</a>
- <a href="hierarchy.html">Tree</a>
-<a href="functions.html">Functions</a>
-<a href="index.html">Home</a>
-<a href="topicals.html"><b>Structure</b></a>
</div>
</table>
<h1 align=center>QSize Class Reference</h1><br clear="all">
<p>
The QSize class defines the size of a two-dimensional object.
<a href="#details">More...</a>
<p>
<code>#include <<a href="qsize-h.html">qsize.h</a>></code>
<p><a href="qsize-members.html">List of all member functions.</a>
<h2>Public Members</h2>
<ul>
<li><div class="fn"><a href="#b494a5"><b>QSize</b></a>()</div>
<li><div class="fn"><a href="#0b36e6"><b>QSize</b></a>(intw, inth)</div>
<li><div class="fn">bool<a href="#ac49ee"><b>isNull</b></a>()const</div>
<li><div class="fn">bool<a href="#8596f2"><b>isEmpty</b></a>()const</div>
<li><div class="fn">bool<a href="#7336d9"><b>isValid</b></a>()const</div>
<li><div class="fn">int<a href="#37cddf"><b>width</b></a>()const</div>
<li><div class="fn">int<a href="#a35c26"><b>height</b></a>()const</div>
<li><div class="fn">void<a href="#464225"><b>setWidth</b></a>(intw)</div>
<li><div class="fn">void<a href="#7e85aa"><b>setHeight</b></a>(inth)</div>
<li><div class="fn">void<a href="#ec144d"><b>transpose</b></a>()</div>
<li><div class="fn">QSize<a href="#a74829"><b>expandedTo</b></a>(constQSize&)const</div>
<li><div class="fn">QSize<a href="#4b5734"><b>boundedTo</b></a>(constQSize&)const</div>
<li><div class="fn">QCOORD&<a href="#6d2e46"><b>rwidth</b></a>()</div>
<li><div class="fn">QCOORD&<a href="#457d54"><b>rheight</b></a>()</div>
<li><div class="fn">QSize&<a href="#14aea3"><b>operator+=</b></a>(constQSize&)</div>
<li><div class="fn">QSize&<a href="#9b556a"><b>operator-=</b></a>(constQSize&)</div>
<li><div class="fn">QSize&<a href="#cbc534"><b>operator*=</b></a>(intc)</div>
<li><div class="fn">QSize&<a href="#2db5ca"><b>operator*=</b></a>(doublec)</div>
<li><div class="fn">QSize&<a href="#e27a46"><b>operator/=</b></a>(intc)</div>
<li><div class="fn">QSize&<a href="#af8132"><b>operator/=</b></a>(doublec)</div>
</ul>
<h2>Related Functions</h2>
(Note that these are not member functions.)
<ul>
<li>QSize <a href="qsize.html#01a760"><b>operator*</b></a> (const QSize & s, int c)
<li>QDataStream & <a href="qsize.html#082a49"><b>operator<<</b></a> (QDataStream & s, const QSize & sz)
<li>QSize <a href="qsize.html#185418"><b>operator/</b></a> (const QSize & s, int c)
<li>QSize <a href="qsize.html#190cfc"><b>operator*</b></a> (const QSize & s, double c)
<li>bool <a href="qsize.html#1cba67"><b>operator!=</b></a> (const QSize & s1, const QSize & s2)
<li>QSize <a href="qsize.html#39f76a"><b>operator-</b></a> (const QSize & s1, const QSize & s2)
<li>QSize <a href="qsize.html#3e1a29"><b>operator+</b></a> (const QSize & s1, const QSize & s2)
<li>QDataStream & <a href="qsize.html#42ce45"><b>operator>></b></a> (QDataStream & s, QSize & sz)
<li>QSize <a href="qsize.html#4d405a"><b>operator*</b></a> (int c, const QSize & s)
<li>bool <a href="qsize.html#7707aa"><b>operator==</b></a> (const QSize & s1, const QSize & s2)
<li>QSize <a href="qsize.html#79c626"><b>operator*</b></a> (double c, const QSize & s)
<li>QSize <a href="qsize.html#d28581"><b>operator/</b></a> (const QSize & s, double c)
</ul>
<hr><h2><a name="details"></a>Detailed Description</h2>
The QSize class defines the size of a two-dimensional object.
<p>
A size is specified by a width and a height.
<p>The coordinate type is QCOORD (defined in <a href="qwindowdefs-h.html">qwindowdefs.h</a> as <code>int).</code>
The minimum value of QCOORD is QCOORD_MIN (-2147483648) and the maximum
value is QCOORD_MAX (2147483647).
<p>See also <a href="qpoint.html">QPoint</a> and <a href="qrect.html">QRect</a>.
<p>Examples:
<a href="xform-xform-cpp.html#QSize">xform/xform.cpp</a>
<a href="menu-menu-cpp.html#QSize">menu/menu.cpp</a>
<a href="progress-progress-cpp.html#QSize">progress/progress.cpp</a>
<a href="qfd-qfd-cpp.html#QSize">qfd/qfd.cpp</a>
<hr><h2>Member Function Documentation</h2>
<h3 class="fn"><a name="b494a5"></a>QSize::QSize()</h3>
<p>Constructs a size with invalid (negative) width and height.
<h3 class="fn"><a name="0b36e6"></a>QSize::QSize(intw, inth)</h3>
<p>Constructs a size with width <em>w</em> and height <em>h.</em>
<h3 class="fn">QSize<a name="4b5734"></a>QSize::boundedTo(constQSize&otherSize)const</h3>
<p>Returns a size with the minimum width and height of this size and
<em>otherSize.</em>
<h3 class="fn">QSize<a name="a74829"></a>QSize::expandedTo(constQSize&otherSize)const</h3>
<p>Returns a size with the maximum width and height of this size and
<em>otherSize.</em>
<h3 class="fn">int<a name="a35c26"></a>QSize::height()const</h3>
<p>Returns the height.
<p>See also <a href="#37cddf">width</a>().
<p>Examples:
<a href="qfd-qfd-cpp.html#height">qfd/qfd.cpp</a>
<h3 class="fn">bool<a name="8596f2"></a>QSize::isEmpty()const</h3>
<p>Returns TRUE if the width is <= 0 or the height is <= 0,
otherwise FALSE.
<h3 class="fn">bool<a name="ac49ee"></a>QSize::isNull()const</h3>
<p>Returns TRUE if the width is 0 and the height is 0, otherwise FALSE.
<h3 class="fn">bool<a name="7336d9"></a>QSize::isValid()const</h3>
<p>Returns TRUE if the width is equal to or greater than 0 and the height is
equal to or greater than 0, otherwise FALSE.
<h3 class="fn">QSize&<a name="2db5ca"></a>QSize::operator*=(doublec)</h3>
<p>Multiplies both the width and height with <em>c</em> and returns a reference to
the size.
<p>Note that the result is truncated.
<h3 class="fn">QSize&<a name="cbc534"></a>QSize::operator*=(intc)</h3>
<p>Multiplies both the width and height with <em>c</em> and returns a reference to
the size.
<h3 class="fn">QSize&<a name="14aea3"></a>QSize::operator+=(constQSize&s)</h3>
<p>Adds <em>s</em> to the size and returns a reference to this size.
<p>Example:
<pre> <a href="qsize.html">QSize</a> s( 3, 7 );
<a href="qsize.html">QSize</a> r( -1, 4 );
s += r; // s becomes (2,11)
</pre>
<h3 class="fn">QSize&<a name="9b556a"></a>QSize::operator-=(constQSize&s)</h3>
<p>Subtracts <em>s</em> from the size and returns a reference to this size.
<p>Example:
<pre> <a href="qsize.html">QSize</a> s( 3, 7 );
<a href="qsize.html">QSize</a> r( -1, 4 );
s -= r; // s becomes (4,3)
</pre>
<h3 class="fn">QSize&<a name="af8132"></a>QSize::operator/=(doublec)</h3>
<p>Divides both the width and height by <em>c</em> and returns a reference to the
size.
<p>Note that the result is truncated.
<h3 class="fn">QSize&<a name="e27a46"></a>QSize::operator/=(intc)</h3>
<p>Divides both the width and height by <em>c</em> and returns a reference to the
size.
<h3 class="fn">QCOORD&<a name="457d54"></a>QSize::rheight()</h3>
<p>Returns a reference to the height.
<p>Using a reference makes it possible to directly manipulate the height.
<p>Example:
<pre> <a href="qsize.html">QSize</a> s( 100, 10 );
s.<a href="#457d54">rheight</a>() += 5; // s becomes (100,15)
</pre>
<p>See also <a href="#6d2e46">rwidth</a>().
<h3 class="fn">QCOORD&<a name="6d2e46"></a>QSize::rwidth()</h3>
<p>Returns a reference to the width.
<p>Using a reference makes it possible to directly manipulate the width.
<p>Example:
<pre> <a href="qsize.html">QSize</a> s( 100, 10 );
s.<a href="#6d2e46">rwidth</a>() += 20; // s becomes (120,10)
</pre>
<p>See also <a href="#457d54">rheight</a>().
<h3 class="fn">void<a name="7e85aa"></a>QSize::setHeight(inth)</h3>
<p>Sets the height to <em>h.</em>
<p>See also <a href="#a35c26">height</a>() and <a href="#464225">setWidth</a>().
<h3 class="fn">void<a name="464225"></a>QSize::setWidth(intw)</h3>
<p>Sets the width to <em>w.</em>
<p>See also <a href="#37cddf">width</a>() and <a href="#7e85aa">setHeight</a>().
<h3 class="fn">void<a name="ec144d"></a>QSize::transpose()</h3>
<p>Swaps the values of width and height.
<h3 class="fn">int<a name="37cddf"></a>QSize::width()const</h3>
<p>Returns the width.
<p>See also <a href="#a35c26">height</a>().
<p>Examples:
<a href="qfd-qfd-cpp.html#width">qfd/qfd.cpp</a>
<hr><h2>Related Functions</h2>
<h3>QSize <a name="01a760"></a>operator* (const QSize & s, int c)</h3>
<p>Multiplies <em>s</em> by <em>c</em> and returns the result.
<h3><a href="qdatastream.html">QDataStream</a> & <a name="082a49"></a>operator<< (<a href="qdatastream.html">QDataStream</a> & s, const QSize & sz)</h3>
<p>Writes the size to the stream and returns a reference to the stream.
<p>See also <a href="datastreamformat.html">Format of the QDataStream operators</a>
<h3>QSize <a name="185418"></a>operator/ (const QSize & s, int c)</h3>
<p>Divides <em>s</em> by <em>c</em> and returns the result.
<h3>QSize <a name="190cfc"></a>operator* (const QSize & s, double c)</h3>
<p>Multiplies <em>s</em> by <em>c</em> and returns the result.
<h3>bool <a name="1cba67"></a>operator!= (const QSize & s1, const QSize & s2)</h3>
<p>Returns TRUE if <em>s1</em> and <em>s2</em> are different, or FALSE if they are equal.
<h3>QSize <a name="39f76a"></a>operator- (const QSize & s1, const QSize & s2)</h3>
<p>Returns <em>s2</em> subtracted from <em>s1;</em> each component is
subtracted separately.
<h3>QSize <a name="3e1a29"></a>operator+ (const QSize & s1, const QSize & s2)</h3>
<p>Returns the sum of <em>s1</em> and <em>s2;</em> each component is added separately.
<h3><a href="qdatastream.html">QDataStream</a> & <a name="42ce45"></a>operator>> (<a href="qdatastream.html">QDataStream</a> & s, QSize & sz)</h3>
<p>Reads the size from the stream and returns a reference to the stream.
<p>See also <a href="datastreamformat.html">Format of the QDataStream operators</a>
<h3>QSize <a name="4d405a"></a>operator* (int c, const QSize & s)</h3>
<p>Multiplies <em>s</em> by <em>c</em> and returns the result.
<h3>bool <a name="7707aa"></a>operator== (const QSize & s1, const QSize & s2)</h3>
<p>Returns TRUE if <em>s1</em> and <em>s2</em> are equal, or FALSE if they are different.
<h3>QSize <a name="79c626"></a>operator* (double c, const QSize & s)</h3>
<p>Multiplies <em>s</em> by <em>c</em> and returns the result.
<h3>QSize <a name="d28581"></a>operator/ (const QSize & s, double c)</h3>
<p>Divides <em>s</em> by <em>c</em> and returns the result.
<p>Note that the result is truncated.
<hr><p>
Search the documentation, FAQ, qt-interest archive and more (uses
<a href="http://www.trolltech.com">www.trolltech.com</a>):<br>
<form method=post action="http://www.trolltech.com/search.cgi">
<input type=hidden name="version" value="2.3.2"><nobr>
<input size="50" name="search"><input type=submit value="Search">
</nobr></form><hr><p>
This file is part of the <a href="index.html">Qt toolkit</a>,
copyright © 1995-2001
<a href="http://www.trolltech.com">Trolltech</a>, all rights reserved.<p><address><hr><div align="center">
<table width="100%" cellspacing="0" border="0"><tr>
<td>Copyright 2001 Trolltech<td><a href="http://www.trolltech.com/trademarks.html">Trademarks</a>
<td align="right"><div align="right">Qt version 2.3.2</div>
</table></div></address></body></html>
|