Home · All Classes · Main Classes · Grouped Classes · Modules · Functions |
The QSizeF class defines the size of a two-dimensional object using floating point values for accuracy. More...
#include <QSizeF>
The QSizeF class defines the size of a two-dimensional object using floating point values for accuracy.
A size is specified by a width and a height.
The coordinate type is qreal.
The size can be set in the constructor and changed with setWidth(), setHeight(), or scale(), or using arithmetic operators. You can swap the width and height with transpose(). You can get a size which holds the maximum height and width of two sizes using expandedTo(), and the minimum height and width of two sizes using boundedTo().
See also QSize, QPointF, and QRectF.
Constructs an invalid size.
See also isValid(), setWidth(), and setHeight().
Constructs a size with floating point accuracy from the given size.
Constructs a size with width width and height height.
Returns a size with the minimum width and height of this size and otherSize.
See also expandedTo(), scale(), setWidth(), and setHeight().
Returns a size with the maximum width and height of this size and otherSize.
See also boundedTo(), scale(), setWidth(), and setHeight().
Returns the height.
See also width() and setHeight().
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.
See also isNull(), isValid(), width(), and height().
Returns true if the width is 0 and the height is 0; otherwise returns false.
See also isValid(), isEmpty(), width(), and height().
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.
See also isNull(), isEmpty(), width(), and height().
Returns a reference to the height.
Using a reference makes it possible to directly manipulate the height.
Example:
QSizeF s(100, 10.2); s.rheight() += 5.5; // s becomes (100,15.7)
See also rwidth() and setHeight().
Returns a reference to the width.
Using a reference makes it possible to directly manipulate the width.
Example:
QSizeF s(100.3, 10); s.rwidth() += 20.5; // s becomes (120.8,10)
See also rheight() and setWidth().
Scales the size to a rectangle of width w and height h according to the Qt::AspectRatioMode mode.
Example:
QSizeF t1(10, 12); t1.scale(60, 60, Qt::IgnoreAspectRatio); // t1 is (60, 60) QSizeF t2(10, 12); t2.scale(60, 60, Qt::KeepAspectRatio); // t2 is (50, 60) QSizeF t3(10, 12); t3.scale(60, 60, Qt::KeepAspectRatioByExpanding); // t3 is (60, 72)
See also boundedTo(), expandedTo(), setWidth(), and setHeight().
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
Equivalent to scale(s.width(), s.height(), mode).
Sets the height to height.
See also height(), setWidth(), expandedTo(), boundedTo(), scale(), and transpose().
Sets the width to width.
See also width(), rwidth(), setHeight(), expandedTo(), boundedTo(), scale(), and transpose().
Returns a size with integer precision. Note that the coordinates in the returned size will be rounded to the nearest integer.
Swaps the width and height values.
See also expandedTo(), boundedTo(), setWidth(), and setHeight().
Returns the width.
See also height() and setWidth().
Multiplies both the width and height by coeff and returns a reference to the size.
Adds s to the size and returns a reference to this size.
Example:
QSizeF s( 3, 7); QSizeF r(-1, 4); s += r; // s becomes (2,11)
Subtracts s from the size and returns a reference to this size.
Example:
QSizeF s( 3, 7); QSizeF r(-1, 4); s -= r; // s becomes (4,3)
Divides both the width and height by divisor and returns a reference to the size.
See also QSize::scale().
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
Returns true if s1 and s2 are different; otherwise returns false.
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
Multiplies size by coeff and returns the result.
See also QSize::scale().
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
Multiplies s by c and returns the result.
See also QSize::scale().
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
Returns the sum of s1 and s2; each component is added separately.
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
Returns s2 subtracted from s1; each component is subtracted separately.
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
Divides size by divisor and returns the result.
See also QSize::scale().
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
Writes the size sz to the stream s and returns a reference to the stream.
See also Format of the QDataStream operators.
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
Returns true if s1 and s2 are equal; otherwise returns false.
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
Reads the size from the stream s into size sz and returns a reference to the stream.
See also Format of the QDataStream operators.
Copyright © 2005 Trolltech | Trademarks | Qt 4.1.0 |