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

QSize Class Reference

List of all members.

Detailed Description

The QSize class defines the size of a two-dimensional object using integer 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 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.

QSize objects can be streamed as well as compared.

See also:
QSizeF, QPoint, QRect

Definition at line 55 of file qsize.h.

Public Member Functions

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

Private Attributes

int ht
int wd


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

Related Functions

(Note that these are not member functions.)

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

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

Generated by  Doxygen 1.6.0   Back to index