<class name="QSizeF" doc="/** <p>The <a href="QSizeF.html#QSizeF()"><tt>QSizeF</tt></a> class defines the size of a two-dimensional object using floating point precision.</p> <p>A size is specified by a <a href="QSizeF.html#width()"><tt>width</tt></a> and a <a href="QSizeF.html#height()"><tt>height</tt></a>. It can be set in the constructor and changed using the <a href="QSizeF.html#setWidth(double)"><tt>setWidth</tt></a>, <a href="QSizeF.html#setHeight(double)"><tt>setHeight</tt></a>, or <a href="QSizeF.html#scale(com.trolltech.qt.core.QSizeF, 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="QSizeF.html#transpose()"><tt>transpose</tt></a> function.</p> <p>The <a href="QSizeF.html#isValid()"><tt>isValid</tt></a> function determines if a size is valid. A valid size has both width and height greater than or equal to zero. The <a href="QSizeF.html#isEmpty()"><tt>isEmpty</tt></a> function returns true if either of the width and height is <i>less</i> than (or equal to) zero, while the <a href="QSizeF.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="QSizeF.html#expandedTo(com.trolltech.qt.core.QSizeF)"><tt>expandedTo</tt></a> function to retrieve a size which holds the maximum height and width of this size and a given size. Similarly, the <a href="QSizeF.html#boundedTo(com.trolltech.qt.core.QSizeF)"><tt>boundedTo</tt></a> function returns a size which holds the minimum height and width of this size and a given size.</p> <p>The <a href="QSizeF.html#QSizeF()"><tt>QSizeF</tt></a> class also provides the <a href="QSizeF.html#toSize()"><tt>toSize</tt></a> function returning a <a href="QSize.html"><tt>QSize</tt></a> copy of this size, constructed by rounding the width and height to the nearest integers.</p> <p><a href="QSizeF.html#QSizeF()"><tt>QSizeF</tt></a> objects can be streamed as well as compared.</p> @see <a href="QSize.html"><tt>QSize</tt></a> @see <a href="QPointF.html"><tt>QPointF</tt></a> @see <a href="QRectF.html"><tt>QRectF</tt></a> */"> <method name="public QSizeF(com.trolltech.qt.core.QSize sz)" doc="/** <p>Constructs a size with floating point accuracy from the given <tt>sz</tt>.</p> @see <a href="QSizeF.html#toSize()"><tt>toSize</tt></a> */"/> <method name="public QSizeF(double w, double h)" doc="/** <p>Constructs a size with the given <tt>w</tt> and <tt>h</tt>.</p> */"/> <method name="public QSizeF()" doc="/** <p>Constructs an invalid size.</p> @see <a href="QSizeF.html#isValid()"><tt>isValid</tt></a> */"/> <method name="public final com.trolltech.qt.core.QSizeF boundedTo(com.trolltech.qt.core.QSizeF 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="QSizeF.html#expandedTo(com.trolltech.qt.core.QSizeF)"><tt>expandedTo</tt></a> @see <a href="QSizeF.html#scale(com.trolltech.qt.core.QSizeF, com.trolltech.qt.core.Qt.AspectRatioMode)"><tt>scale</tt></a> */"/> <method name="public final com.trolltech.qt.core.QSizeF expandedTo(com.trolltech.qt.core.QSizeF 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="QSizeF.html#boundedTo(com.trolltech.qt.core.QSizeF)"><tt>boundedTo</tt></a> @see <a href="QSizeF.html#scale(com.trolltech.qt.core.QSizeF, com.trolltech.qt.core.Qt.AspectRatioMode)"><tt>scale</tt></a> */"/> <method name="public final double height()" doc="/** <p>Returns the height.</p> @see <a href="QSizeF.html#width()"><tt>width</tt></a> @see <a href="QSizeF.html#setHeight(double)"><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="QSizeF.html#isNull()"><tt>isNull</tt></a> @see <a href="QSizeF.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="QSizeF.html#isValid()"><tt>isValid</tt></a> @see <a href="QSizeF.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="QSizeF.html#isNull()"><tt>isNull</tt></a> @see <a href="QSizeF.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(double w, double 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> QSizeF t1(10, 12); t1.scale(60, 60, Qt::IgnoreAspectRatio); <span class="comment"> // t1 is (60, 60)</span> QSizeF t2(10, 12); t2.scale(60, 60, Qt::KeepAspectRatio); <span class="comment"> // t2 is (50, 60)</span> QSizeF t3(10, 12); t3.scale(60, 60, Qt::KeepAspectRatioByExpanding); <span class="comment"> // t3 is (60, 72)</span></pre> @see <a href="QSizeF.html#setWidth(double)"><tt>setWidth</tt></a> @see <a href="QSizeF.html#setHeight(double)"><tt>setHeight</tt></a> */"/> <method name="public final void scale(com.trolltech.qt.core.QSizeF 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 setHeight(double h)" doc="/** <p>Sets the height to the given <tt>h</tt>.</p> @see <a href="QSizeF.html#height()"><tt>height</tt></a> @see <tt>rheight</tt> @see <a href="QSizeF.html#setWidth(double)"><tt>setWidth</tt></a> */"/> <method name="public final void setWidth(double w)" doc="/** <p>Sets the width to the given <tt>w</tt>.</p> @see <a href="QSizeF.html#width()"><tt>width</tt></a> @see <tt>rwidth</tt> @see <a href="QSizeF.html#setHeight(double)"><tt>setHeight</tt></a> */"/> <method name="public final com.trolltech.qt.core.QSize toSize()" doc="/** <p>Returns an integer based copy of this size.</p> <p>Note that the coordinates in the returned size will be rounded to the nearest integer.</p> @see <a href="QSizeF.html#QSizeF()"><tt>QSizeF</tt></a> */"/> <method name="public final void transpose()" doc="/** <p>Swaps the width and height values.</p> @see <a href="QSizeF.html#setWidth(double)"><tt>setWidth</tt></a> @see <a href="QSizeF.html#setHeight(double)"><tt>setHeight</tt></a> */"/> <method name="public final double width()" doc="/** <p>Returns the width.</p> @see <a href="QSizeF.html#height()"><tt>height</tt></a> @see <a href="QSizeF.html#setWidth(double)"><tt>setWidth</tt></a> */"/> </class>