<class name="QSize" doc="/** <p>The <a href="QSize.html#QSize()"><tt>QSize</tt></a> 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()"><tt>width</tt></a> and a <a href="QSize.html#height()"><tt>height</tt></a>. It can be set in the constructor and changed using the <a href="QSize.html#setWidth(int)"><tt>setWidth</tt></a>, <a href="QSize.html#setHeight(int)"><tt>setHeight</tt></a>, or <a href="QSize.html#scale(int, int, com.trolltech.qt.core.Qt.AspectRatioMode)"><tt>scale</tt></a> functions, or using arithmetic operators. A size can also be manipulated directly by retrieving references to the width and height using the rwidth() and rheight() functions. Finally, the width and height can be swapped using the <a href="QSize.html#transpose()"><tt>transpose</tt></a> function.</p> <p>The <a href="QSize.html#isValid()"><tt>isValid</tt></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()"><tt>isEmpty</tt></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()"><tt>isNull</tt></a> function returns true only if both the width and the height is zero.</p> <p>Use the <a href="QSize.html#expandedTo(com.trolltech.qt.core.QSize)"><tt>expandedTo</tt></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(com.trolltech.qt.core.QSize)"><tt>boundedTo</tt></a> function returns a size which holds the minimum height and width of <i>this</i> size and a given size.</p> <p><a href="QSize.html#QSize()"><tt>QSize</tt></a> objects can be streamed as well as compared.</p> @see <a href="QSizeF.html"><tt>QSizeF</tt></a> @see <a href="QPoint.html"><tt>QPoint</tt></a> @see <a href="QRect.html"><tt>QRect</tt></a> */"> <method name="public QSize(int w, int h)" doc="/** <p>Constructs a size with the given <tt>w</tt> and <tt>h</tt>.</p> @see <a href="QSize.html#setWidth(int)"><tt>setWidth</tt></a> @see <a href="QSize.html#setHeight(int)"><tt>setHeight</tt></a> */"/> <method name="public QSize()" doc="/** <p>Constructs a size with an invalid width and height (i.e&#x2e;, <a href="QSize.html#isValid()"><tt>isValid</tt></a> returns false).</p> @see <a href="QSize.html#isValid()"><tt>isValid</tt></a> */"/> <method name="public final com.trolltech.qt.core.QSize boundedTo(com.trolltech.qt.core.QSize arg__1)" doc="/** <p>Returns a size holding the minimum width and height of this size and the given <tt>arg__1</tt>.</p> @see <a href="QSize.html#expandedTo(com.trolltech.qt.core.QSize)"><tt>expandedTo</tt></a> @see <a href="QSize.html#scale(int, int, com.trolltech.qt.core.Qt.AspectRatioMode)"><tt>scale</tt></a> */"/> <method name="public final com.trolltech.qt.core.QSize expandedTo(com.trolltech.qt.core.QSize arg__1)" doc="/** <p>Returns a size holding the maximum width and height of this size and the given <tt>arg__1</tt>.</p> @see <a href="QSize.html#boundedTo(com.trolltech.qt.core.QSize)"><tt>boundedTo</tt></a> @see <a href="QSize.html#scale(int, int, com.trolltech.qt.core.Qt.AspectRatioMode)"><tt>scale</tt></a> */"/> <method name="public final int height()" doc="/** <p>Returns the height.</p> @see <a href="QSize.html#width()"><tt>width</tt></a> @see <a href="QSize.html#setHeight(int)"><tt>setHeight</tt></a> */"/> <method name="public final boolean isEmpty()" doc="/** <p>Returns true if either of the width and height is less than or equal to 0; otherwise returns false.</p> @see <a href="QSize.html#isNull()"><tt>isNull</tt></a> @see <a href="QSize.html#isValid()"><tt>isValid</tt></a> */"/> <method name="public final boolean isNull()" doc="/** <p>Returns true if both the width and height is 0; otherwise returns false.</p> @see <a href="QSize.html#isValid()"><tt>isValid</tt></a> @see <a href="QSize.html#isEmpty()"><tt>isEmpty</tt></a> */"/> <method name="public final boolean isValid()" doc="/** <p>Returns true if both the width and height is equal to or greater than 0; otherwise returns false.</p> @see <a href="QSize.html#isNull()"><tt>isNull</tt></a> @see <a href="QSize.html#isEmpty()"><tt>isEmpty</tt></a> */"/> <method name="public final void writeTo(com.trolltech.qt.core.QDataStream arg__1)"/> <method name="public final void readFrom(com.trolltech.qt.core.QDataStream arg__1)"/> <method name="public final void scale(com.trolltech.qt.core.QSize s, com.trolltech.qt.core.Qt.AspectRatioMode mode)" doc="/** <p>Scales the size to a rectangle with the given <tt>s</tt>, according to the specified <tt>mode</tt>.</p> */"/> <method name="public final void scale(int w, int h, com.trolltech.qt.core.Qt.AspectRatioMode mode)" doc="/** <p>Scales the size to a rectangle with the given <tt>w</tt> and <tt>h</tt>, according to the specified <tt>mode</tt>:</p> <ul> <li>If <tt>mode</tt> is Qt::IgnoreAspectRatio, the size is set to (<tt>w</tt>, <tt>h</tt>).</li> <li>If <tt>mode</tt> is Qt::KeepAspectRatio, the current size is scaled to a rectangle as large as possible inside (<tt>w</tt>, <tt>h</tt>), preserving the aspect ratio.</li> <li>If <tt>mode</tt> is Qt::KeepAspectRatioByExpanding, the current size is scaled to a rectangle as small as possible outside (<tt>w</tt>, <tt>h</tt>), preserving the aspect ratio.</li> </ul> <p>Example:</p> <pre> QSize t1(10, 12); t1.scale(60, 60, Qt::IgnoreAspectRatio); <span class="comment"> // t1 is (60, 60)</span> QSize t2(10, 12); t2.scale(60, 60, Qt::KeepAspectRatio); <span class="comment"> // t2 is (50, 60)</span> QSize t3(10, 12); t3.scale(60, 60, Qt::KeepAspectRatioByExpanding); <span class="comment"> // t3 is (60, 72)</span></pre> @see <a href="QSize.html#setWidth(int)"><tt>setWidth</tt></a> @see <a href="QSize.html#setHeight(int)"><tt>setHeight</tt></a> */"/> <method name="public final void setHeight(int h)" doc="/** <p>Sets the height to the given <tt>h</tt>.</p> @see <tt>rheight</tt> @see <a href="QSize.html#height()"><tt>height</tt></a> @see <a href="QSize.html#setWidth(int)"><tt>setWidth</tt></a> */"/> <method name="public final void setWidth(int w)" doc="/** <p>Sets the width to the given <tt>w</tt>.</p> @see <tt>rwidth</tt> @see <a href="QSize.html#width()"><tt>width</tt></a> @see <a href="QSize.html#setHeight(int)"><tt>setHeight</tt></a> */"/> <method name="public final void transpose()" doc="/** <p>Swaps the width and height values.</p> @see <a href="QSize.html#setWidth(int)"><tt>setWidth</tt></a> @see <a href="QSize.html#setHeight(int)"><tt>setHeight</tt></a> */"/> <method name="public final int width()" doc="/** <p>Returns the width.</p> @see <a href="QSize.html#height()"><tt>height</tt></a> @see <a href="QSize.html#setWidth(int)"><tt>setWidth</tt></a> */"/> </class>