diff options
author | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2011-07-10 15:24:15 -0500 |
---|---|---|
committer | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2011-07-10 15:24:15 -0500 |
commit | bd0f3345a938b35ce6a12f6150373b0955b8dd12 (patch) | |
tree | 7a520322212d48ebcb9fbe1087e7fca28b76185c /doc/html/qsize.html | |
download | qt3-bd0f3345a938b35ce6a12f6150373b0955b8dd12.tar.gz qt3-bd0f3345a938b35ce6a12f6150373b0955b8dd12.zip |
Add Qt3 development HEAD version
Diffstat (limited to 'doc/html/qsize.html')
-rw-r--r-- | doc/html/qsize.html | 378 |
1 files changed, 378 insertions, 0 deletions
diff --git a/doc/html/qsize.html b/doc/html/qsize.html new file mode 100644 index 0000000..5ed73ca --- /dev/null +++ b/doc/html/qsize.html @@ -0,0 +1,378 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> +<!-- /home/espenr/tmp/qt-3.3.8-espenr-2499/qt-x11-free-3.3.8/src/kernel/qsize.cpp:42 --> +<html> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> +<title>QSize Class</title> +<style type="text/css"><!-- +fn { margin-left: 1cm; text-indent: -1cm; } +a:link { color: #004faf; text-decoration: none } +a:visited { color: #672967; text-decoration: none } +body { background: #ffffff; color: black; } +--></style> +</head> +<body> + +<table border="0" cellpadding="0" cellspacing="0" width="100%"> +<tr bgcolor="#E5E5E5"> +<td 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="mainclasses.html"> +<font color="#004faf">Main Classes</font></a> + | <a href="annotated.html"> +<font color="#004faf">Annotated</font></a> + | <a href="groups.html"> +<font color="#004faf">Grouped Classes</font></a> + | <a href="functions.html"> +<font color="#004faf">Functions</font></a> +</td> +<td align="right" valign="center"><img src="logo32.png" align="right" width="64" height="32" border="0"></td></tr></table><h1 align=center>QSize Class Reference</h1> + +<p>The QSize class defines the size of a two-dimensional object. +<a href="#details">More...</a> +<p><tt>#include <<a href="qsize-h.html">qsize.h</a>></tt> +<p><a href="qsize-members.html">List of all member functions.</a> +<h2>Public Members</h2> +<ul> +<li class=fn>enum <a href="#ScaleMode-enum"><b>ScaleMode</b></a> { ScaleFree, ScaleMin, ScaleMax }</li> +<li class=fn><a href="#QSize"><b>QSize</b></a> ()</li> +<li class=fn><a href="#QSize-2"><b>QSize</b></a> ( int w, int h )</li> +<li class=fn>bool <a href="#isNull"><b>isNull</b></a> () const</li> +<li class=fn>bool <a href="#isEmpty"><b>isEmpty</b></a> () const</li> +<li class=fn>bool <a href="#isValid"><b>isValid</b></a> () const</li> +<li class=fn>int <a href="#width"><b>width</b></a> () const</li> +<li class=fn>int <a href="#height"><b>height</b></a> () const</li> +<li class=fn>void <a href="#setWidth"><b>setWidth</b></a> ( int w )</li> +<li class=fn>void <a href="#setHeight"><b>setHeight</b></a> ( int h )</li> +<li class=fn>void <a href="#transpose"><b>transpose</b></a> ()</li> +<li class=fn>void <a href="#scale"><b>scale</b></a> ( int w, int h, ScaleMode mode )</li> +<li class=fn>void <a href="#scale-2"><b>scale</b></a> ( const QSize & s, ScaleMode mode )</li> +<li class=fn>QSize <a href="#expandedTo"><b>expandedTo</b></a> ( const QSize & otherSize ) const</li> +<li class=fn>QSize <a href="#boundedTo"><b>boundedTo</b></a> ( const QSize & otherSize ) const</li> +<li class=fn>QCOORD & <a href="#rwidth"><b>rwidth</b></a> ()</li> +<li class=fn>QCOORD & <a href="#rheight"><b>rheight</b></a> ()</li> +<li class=fn>QSize & <a href="#operator+-eq"><b>operator+=</b></a> ( const QSize & s )</li> +<li class=fn>QSize & <a href="#operator--eq"><b>operator-=</b></a> ( const QSize & s )</li> +<li class=fn>QSize & <a href="#operator*-eq"><b>operator*=</b></a> ( int c )</li> +<li class=fn>QSize & <a href="#operator*-eq-2"><b>operator*=</b></a> ( double c )</li> +<li class=fn>QSize & <a href="#operator/-eq"><b>operator/=</b></a> ( int c )</li> +<li class=fn>QSize & <a href="#operator/-eq-2"><b>operator/=</b></a> ( double c )</li> +</ul> +<h2>Related Functions</h2> +<ul> +<li class=fn>bool <a href="#operator-eq-eq"><b>operator==</b></a> ( const QSize & s1, const QSize & s2 )</li> +<li class=fn>bool <a href="#operator!-eq"><b>operator!=</b></a> ( const QSize & s1, const QSize & s2 )</li> +<li class=fn>const QSize <a href="#operator+"><b>operator+</b></a> ( const QSize & s1, const QSize & s2 )</li> +<li class=fn>const QSize <a href="#operator-"><b>operator-</b></a> ( const QSize & s1, const QSize & s2 )</li> +<li class=fn>const QSize <a href="#operator*"><b>operator*</b></a> ( const QSize & s, int c )</li> +<li class=fn>const QSize <a href="#operator*-2"><b>operator*</b></a> ( int c, const QSize & s )</li> +<li class=fn>const QSize <a href="#operator*-3"><b>operator*</b></a> ( const QSize & s, double c )</li> +<li class=fn>const QSize <a href="#operator*-4"><b>operator*</b></a> ( double c, const QSize & s )</li> +<li class=fn>const QSize <a href="#operator/"><b>operator/</b></a> ( const QSize & s, int c )</li> +<li class=fn>const QSize <a href="#operator/-2"><b>operator/</b></a> ( const QSize & s, double c )</li> +<li class=fn>QDataStream & <a href="#operator-lt-lt"><b>operator<<</b></a> ( QDataStream & s, const QSize & sz )</li> +<li class=fn>QDataStream & <a href="#operator-gt-gt"><b>operator>></b></a> ( QDataStream & s, QSize & sz )</li> +</ul> +<hr><a name="details"></a><h2>Detailed Description</h2> + + +The QSize class defines the size of a two-dimensional object. +<p> + +<p> A size is specified by a width and a height. +<p> The coordinate type is QCOORD (defined in <tt><qwindowdefs.h></tt> as <tt>int</tt>). +The minimum value of QCOORD is QCOORD_MIN (-2147483648) and the maximum +value is QCOORD_MAX (2147483647). +<p> The size can be set in the constructor and changed with <a href="#setWidth">setWidth</a>() +and <a href="#setHeight">setHeight</a>(), or using <a href="#operator+-eq">operator+=</a>(), <a href="#operator--eq">operator-=</a>(), <a href="#operator*-eq">operator*=</a>() +and <a href="#operator/-eq">operator/=</a>(), etc. You can swap the width and height with +<a href="#transpose">transpose</a>(). You can get a size which holds the maximum height and +width of two sizes using <a href="#expandedTo">expandedTo</a>(), and the minimum height and +width of two sizes using <a href="#boundedTo">boundedTo</a>(). +<p> <p>See also <a href="qpoint.html">QPoint</a>, <a href="qrect.html">QRect</a>, <a href="graphics.html">Graphics Classes</a>, and <a href="images.html">Image Processing Classes</a>. + +<hr><h2>Member Type Documentation</h2> +<h3 class=fn><a name="ScaleMode-enum"></a>QSize::ScaleMode</h3> +<p> This enum type defines the different ways of scaling a size. +<p> <center><img src="scaling.png"></center> +<ul> +<li><tt>QSize::ScaleFree</tt> - The size is scaled freely. The ratio is not preserved. +<li><tt>QSize::ScaleMin</tt> - The size is scaled to a rectangle as large as possible +inside a given rectangle, preserving the aspect ratio. +<li><tt>QSize::ScaleMax</tt> - The size is scaled to a rectangle as small as possible +outside a given rectangle, preserving the aspect ratio. +</ul><p> <p>See also <a href="#scale">QSize::scale</a>(), <a href="qimage.html#scale">QImage::scale</a>(), and <a href="qimage.html#smoothScale">QImage::smoothScale</a>(). + +<hr><h2>Member Function Documentation</h2> +<h3 class=fn><a name="QSize"></a>QSize::QSize () +</h3> + +Constructs a size with invalid (negative) width and height. + +<h3 class=fn><a name="QSize-2"></a>QSize::QSize ( int w, int h ) +</h3> + +Constructs a size with width <em>w</em> and height <em>h</em>. + +<h3 class=fn><a href="qsize.html">QSize</a> <a name="boundedTo"></a>QSize::boundedTo ( const <a href="qsize.html">QSize</a> & otherSize ) const +</h3> + +<p> Returns a size with the minimum width and height of this size and +<em>otherSize</em>. + +<h3 class=fn><a href="qsize.html">QSize</a> <a name="expandedTo"></a>QSize::expandedTo ( const <a href="qsize.html">QSize</a> & otherSize ) const +</h3> + +<p> Returns a size with the maximum width and height of this size and +<em>otherSize</em>. + +<p>Examples: <a href="customlayout-example.html#x1528">customlayout/card.cpp</a> and <a href="customlayout-example.html#x1485">customlayout/flow.cpp</a>. +<h3 class=fn>int <a name="height"></a>QSize::height () const +</h3> + +Returns the height. +<p>See also <a href="#width">width</a>(). + +<p>Examples: <a href="movies-example.html#x520">movies/main.cpp</a>, <a href="qfd-example.html#x2007">qfd/fontdisplayer.cpp</a>, and <a href="qfd-example.html#x2016">qfd/qfd.cpp</a>. +<h3 class=fn>bool <a name="isEmpty"></a>QSize::isEmpty () const +</h3> + +Returns TRUE if the width is less than or equal to 0, or the height is +less than or equal to 0; otherwise returns FALSE. + +<h3 class=fn>bool <a name="isNull"></a>QSize::isNull () const +</h3> + +Returns TRUE if the width is 0 and the height is 0; otherwise +returns FALSE. + +<h3 class=fn>bool <a name="isValid"></a>QSize::isValid () const +</h3> + +Returns TRUE if the width is equal to or greater than 0 and the height is +equal to or greater than 0; otherwise returns FALSE. + +<h3 class=fn><a href="qsize.html">QSize</a> & <a name="operator*-eq"></a>QSize::operator*= ( int c ) +</h3> + +Multiplies both the width and height by <em>c</em> and returns a reference to +the size. + +<h3 class=fn><a href="qsize.html">QSize</a> & <a name="operator*-eq-2"></a>QSize::operator*= ( double c ) +</h3> +This is an overloaded member function, provided for convenience. It behaves essentially like the above function. +<p> Multiplies 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><a href="qsize.html">QSize</a> & <a name="operator+-eq"></a>QSize::operator+= ( const <a href="qsize.html">QSize</a> & s ) +</h3> + +<p> Adds <em>s</em> to the size and returns a reference to this size. +<p> Example: +<pre> + QSize s( 3, 7 ); + QSize r( -1, 4 ); + s += r; // s becomes (2,11) +</pre> + + +<h3 class=fn><a href="qsize.html">QSize</a> & <a name="operator--eq"></a>QSize::operator-= ( const <a href="qsize.html">QSize</a> & s ) +</h3> + +<p> Subtracts <em>s</em> from the size and returns a reference to this size. +<p> Example: +<pre> + QSize s( 3, 7 ); + QSize r( -1, 4 ); + s -= r; // s becomes (4,3) + </pre> + + +<h3 class=fn><a href="qsize.html">QSize</a> & <a name="operator/-eq"></a>QSize::operator/= ( int c ) +</h3> + +Divides both the width and height by <em>c</em> and returns a reference to the +size. + +<h3 class=fn><a href="qsize.html">QSize</a> & <a name="operator/-eq-2"></a>QSize::operator/= ( double c ) +</h3> + +This is an overloaded member function, provided for convenience. It behaves essentially like the above function. +<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>QCOORD & <a name="rheight"></a>QSize::rheight () +</h3> + +Returns a reference to the height. +<p> Using a reference makes it possible to directly manipulate the height. +<p> Example: +<pre> + QSize s( 100, 10 ); + s.<a href="#rheight">rheight</a>() += 5; // s becomes (100,15) + </pre> + +<p> <p>See also <a href="#rwidth">rwidth</a>(). + +<h3 class=fn>QCOORD & <a name="rwidth"></a>QSize::rwidth () +</h3> + +Returns a reference to the width. +<p> Using a reference makes it possible to directly manipulate the width. +<p> Example: +<pre> + QSize s( 100, 10 ); + s.<a href="#rwidth">rwidth</a>() += 20; // s becomes (120,10) + </pre> + +<p> <p>See also <a href="#rheight">rheight</a>(). + +<h3 class=fn>void <a name="scale"></a>QSize::scale ( int w, int h, <a href="qsize.html#ScaleMode-enum">ScaleMode</a> mode ) +</h3> +Scales the size to a rectangle of width <em>w</em> and height <em>h</em> according +to the ScaleMode <em>mode</em>. +<p> <ul> +<li> If <em>mode</em> is <a href="#ScaleMode-enum">ScaleFree</a>, the size is set to (<em>w</em>, <em>h</em>). +<li> If <em>mode</em> is <a href="#ScaleMode-enum">ScaleMin</a>, the current size is scaled to a rectangle +as large as possible inside (<em>w</em>, <em>h</em>), preserving the aspect ratio. +<li> If <em>mode</em> is <a href="#ScaleMode-enum">ScaleMax</a>, the current size is scaled to a rectangle +as small as possible outside (<em>w</em>, <em>h</em>), preserving the aspect ratio. +</ul> +<p> Example: +<pre> + QSize t1( 10, 12 ); + t1.<a href="#scale">scale</a>( 60, 60, QSize::<a href="#ScaleMode-enum">ScaleFree</a> ); + // t1 is (60, 60) + + QSize t2( 10, 12 ); + t2.<a href="#scale">scale</a>( 60, 60, QSize::<a href="#ScaleMode-enum">ScaleMin</a> ); + // t2 is (50, 60) + + QSize t3( 10, 12 ); + t3.<a href="#scale">scale</a>( 60, 60, QSize::<a href="#ScaleMode-enum">ScaleMax</a> ); + // t3 is (60, 72) + </pre> + + +<h3 class=fn>void <a name="scale-2"></a>QSize::scale ( const <a href="qsize.html">QSize</a> & s, <a href="qsize.html#ScaleMode-enum">ScaleMode</a> mode ) +</h3> +This is an overloaded member function, provided for convenience. It behaves essentially like the above function. +<p> Equivalent to <a href="#scale">scale</a>(<em>s</em>.<a href="#width">width</a>(), <em>s</em>.<a href="#height">height</a>(), <em>mode</em>). + +<h3 class=fn>void <a name="setHeight"></a>QSize::setHeight ( int h ) +</h3> + +Sets the height to <em>h</em>. +<p>See also <a href="#height">height</a>() and <a href="#setWidth">setWidth</a>(). + +<h3 class=fn>void <a name="setWidth"></a>QSize::setWidth ( int w ) +</h3> + +Sets the width to <em>w</em>. +<p>See also <a href="#width">width</a>() and <a href="#setHeight">setHeight</a>(). + +<h3 class=fn>void <a name="transpose"></a>QSize::transpose () +</h3> +Swaps the values of width and height. + +<h3 class=fn>int <a name="width"></a>QSize::width () const +</h3> + +Returns the width. +<p>See also <a href="#height">height</a>(). + +<p>Examples: <a href="movies-example.html#x521">movies/main.cpp</a>, <a href="qfd-example.html#x2008">qfd/fontdisplayer.cpp</a>, and <a href="qfd-example.html#x2017">qfd/qfd.cpp</a>. +<hr><h2>Related Functions</h2> +<h3 class=fn>bool <a name="operator!-eq"></a>operator!= ( const <a href="qsize.html">QSize</a> & s1, const <a href="qsize.html">QSize</a> & s2 ) +</h3> + + +Returns TRUE if <em>s1</em> and <em>s2</em> are different; otherwise returns FALSE. + +<h3 class=fn>const <a href="qsize.html">QSize</a> <a name="operator*"></a>operator* ( const <a href="qsize.html">QSize</a> & s, int c ) +</h3> + + +Multiplies <em>s</em> by <em>c</em> and returns the result. + +<h3 class=fn>const <a href="qsize.html">QSize</a> <a name="operator*-2"></a>operator* ( int c, const <a href="qsize.html">QSize</a> & s ) +</h3> +This is an overloaded member function, provided for convenience. It behaves essentially like the above function. +<p> +Multiplies <em>s</em> by <em>c</em> and returns the result. + +<h3 class=fn>const <a href="qsize.html">QSize</a> <a name="operator*-3"></a>operator* ( const <a href="qsize.html">QSize</a> & s, double c ) +</h3> +This is an overloaded member function, provided for convenience. It behaves essentially like the above function. +<p> +Multiplies <em>s</em> by <em>c</em> and returns the result. + +<h3 class=fn>const <a href="qsize.html">QSize</a> <a name="operator*-4"></a>operator* ( double c, const <a href="qsize.html">QSize</a> & s ) +</h3> +This is an overloaded member function, provided for convenience. It behaves essentially like the above function. +<p> +Multiplies <em>s</em> by <em>c</em> and returns the result. + +<h3 class=fn>const <a href="qsize.html">QSize</a> <a name="operator+"></a>operator+ ( const <a href="qsize.html">QSize</a> & s1, const <a href="qsize.html">QSize</a> & s2 ) +</h3> + + +Returns the sum of <em>s1</em> and <em>s2</em>; each component is added separately. + +<h3 class=fn>const <a href="qsize.html">QSize</a> <a name="operator-"></a>operator- ( const <a href="qsize.html">QSize</a> & s1, const <a href="qsize.html">QSize</a> & s2 ) +</h3> + + +Returns <em>s2</em> subtracted from <em>s1</em>; each component is +subtracted separately. + +<h3 class=fn>const <a href="qsize.html">QSize</a> <a name="operator/"></a>operator/ ( const <a href="qsize.html">QSize</a> & s, int c ) +</h3> + + +Divides <em>s</em> by <em>c</em> and returns the result. + +<h3 class=fn>const <a href="qsize.html">QSize</a> <a name="operator/-2"></a>operator/ ( const <a href="qsize.html">QSize</a> & s, double c ) +</h3> + + +This is an overloaded member function, provided for convenience. It behaves essentially like the above function. +<p> Divides <em>s</em> by <em>c</em> and returns the result. +<p> Note that the result is truncated. + +<h3 class=fn><a href="qdatastream.html">QDataStream</a> & <a name="operator-lt-lt"></a>operator<< ( <a href="qdatastream.html">QDataStream</a> & s, const <a href="qsize.html">QSize</a> & sz ) +</h3> + +Writes the size <em>sz</em> to the stream <em>s</em> and returns a reference to +the stream. +<p> <p>See also <a href="datastreamformat.html">Format of the QDataStream operators</a>. + +<h3 class=fn>bool <a name="operator-eq-eq"></a>operator== ( const <a href="qsize.html">QSize</a> & s1, const <a href="qsize.html">QSize</a> & s2 ) +</h3> + + +Returns TRUE if <em>s1</em> and <em>s2</em> are equal; otherwise returns FALSE. + +<h3 class=fn><a href="qdatastream.html">QDataStream</a> & <a name="operator-gt-gt"></a>operator>> ( <a href="qdatastream.html">QDataStream</a> & s, <a href="qsize.html">QSize</a> & sz ) +</h3> + +Reads the size from the stream <em>s</em> into size <em>sz</em> and returns a +reference to the stream. +<p> <p>See also <a href="datastreamformat.html">Format of the QDataStream operators</a>. + +<!-- eof --> +<hr><p> +This file is part of the <a href="index.html">Qt toolkit</a>. +Copyright © 1995-2007 +<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 © 2007 +<a href="troll.html">Trolltech</a><td align=center><a href="trademarks.html">Trademarks</a> +<td align=right><div align=right>Qt 3.3.8</div> +</table></div></address></body> +</html> |