Logo Search packages:      
Sourcecode: qt4-x11 version File versions  Download package

QSizeF Class Reference

List of all members.

Detailed Description

The QSizeF class defines the size of a two-dimensional object using floating point precision.

A size is specified by a width() and a height(). It can be set in the constructor and changed using the setWidth(), setHeight(), or scale() 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 transpose() function.

The isValid() function determines if a size is valid. A valid size has both width and height greater than or equal to zero. The isEmpty() function returns true if either of the width and height is less than (or equal to) zero, while the isNull() function returns true only if both the width and the height is zero.

Use the expandedTo() function to retrieve a size which holds the maximum height and width of this size and a given size. Similarly, the boundedTo() function returns a size which holds the minimum height and width of this size and a given size.

The QSizeF class also provides the toSize() function returning a QSize copy of this size, constructed by rounding the width and height to the nearest integers.

QSizeF objects can be streamed as well as compared.

See also:
QSize, QPointF, QRectF

Definition at line 200 of file qsize.h.

Public Member Functions

QSizeF boundedTo (const QSizeF &) const
QSizeF expandedTo (const QSizeF &) const
qreal height () const
bool isEmpty () const
bool isNull () const
bool isValid () const
QSizeFoperator*= (qreal c)
QSizeFoperator+= (const QSizeF &)
QSizeFoperator-= (const QSizeF &)
QSizeFoperator/= (qreal c)
 QSizeF (qreal w, qreal h)
 QSizeF (const QSize &sz)
 QSizeF ()
qreal & rheight ()
qreal & rwidth ()
void scale (const QSizeF &s, Qt::AspectRatioMode mode)
void scale (qreal w, qreal h, Qt::AspectRatioMode mode)
void setHeight (qreal h)
void setWidth (qreal w)
QSize toSize () const
void transpose ()
qreal width () const

Private Attributes

qreal ht
qreal wd


bool operator!= (const QSizeF &, const QSizeF &)
const QSizeF operator* (qreal, const QSizeF &)
const QSizeF operator* (const QSizeF &, qreal)
const QSizeF operator+ (const QSizeF &, const QSizeF &)
const QSizeF operator- (const QSizeF &, const QSizeF &)
const QSizeF operator/ (const QSizeF &, qreal)
bool operator== (const QSizeF &, const QSizeF &)

Related Functions

(Note that these are not member functions.)

QDataStreamoperator<< (QDataStream &stream, const QSizeF &size)
QDataStreamoperator>> (QDataStream &stream, QSizeF &size)

The documentation for this class was generated from the following files:

Generated by  Doxygen 1.6.0   Back to index