Eneboo - Documentación para desarrolladores
Tipos públicos | Métodos públicos | Amigas | Funciones relacionadas
Referencia de la Clase QSize

The QSize class defines the size of a two-dimensional object. Más...

#include <qsize.h>

Lista de todos los miembros.

Tipos públicos

enum  ScaleMode {
  ScaleFree, ScaleMin, ScaleMax, ScaleFree,
  ScaleMin, ScaleMax
}
enum  ScaleMode {
  ScaleFree, ScaleMin, ScaleMax, ScaleFree,
  ScaleMin, ScaleMax
}

Métodos públicos

 QSize ()
 QSize (int w, int h)
bool isNull () const
bool isEmpty () const
bool isValid () const
int width () const
int height () const
void setWidth (int w)
void setHeight (int h)
void transpose ()
void scale (int w, int h, ScaleMode mode)
void scale (const QSize &s, ScaleMode mode)
QSize expandedTo (const QSize &) const
QSize boundedTo (const QSize &) const
QCOORDrwidth ()
QCOORDrheight ()
QSizeoperator+= (const QSize &)
QSizeoperator-= (const QSize &)
QSizeoperator*= (int c)
QSizeoperator*= (double c)
QSizeoperator/= (int c)
QSizeoperator/= (double c)
 QSize ()
 QSize (int w, int h)
bool isNull () const
bool isEmpty () const
bool isValid () const
int width () const
int height () const
void setWidth (int w)
void setHeight (int h)
void transpose ()
void scale (int w, int h, ScaleMode mode)
void scale (const QSize &s, ScaleMode mode)
QSize expandedTo (const QSize &) const
QSize boundedTo (const QSize &) const
QCOORDrwidth ()
QCOORDrheight ()
QSizeoperator+= (const QSize &)
QSizeoperator-= (const QSize &)
QSizeoperator*= (int c)
QSizeoperator*= (double c)
QSizeoperator/= (int c)
QSizeoperator/= (double c)

Amigas

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

Funciones relacionadas

(Observar que estas no son funciones miembro.)

const QSize operator
const QSize operator
const QSize operator
QDataStreamoperator<< (QDataStream &s, const QSize &sz)
QDataStreamoperator>> (QDataStream &s, QSize &sz)

Descripción detallada

The QSize class defines the size of a two-dimensional object.

A size is specified by a width and a height.

The coordinate type is QCOORD (defined in <qwindowdefs.h> as int). The minimum value of QCOORD is QCOORD_MIN (-2147483648) and the maximum value is QCOORD_MAX (2147483647).

The size can be set in the constructor and changed with setWidth() and setHeight(), or using operator+=(), operator-=(), operator*=() and operator/=(), etc. 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().

Ver también:
QPoint, QRect

Documentación de las enumeraciones miembro de la clase

This enum type defines the different ways of scaling a size.

scaling.png

ScaleFree The size is scaled freely. The ratio is not preserved. ScaleMin The size is scaled to a rectangle as large as possible inside a given rectangle, preserving the aspect ratio. ScaleMax The size is scaled to a rectangle as small as possible outside a given rectangle, preserving the aspect ratio.

Ver también:
QSize::scale(), QImage::scale(), QImage::smoothScale()
Valores de enumeraciones:
ScaleFree 
ScaleMin 
ScaleMax 
ScaleFree 
ScaleMin 
ScaleMax 
Valores de enumeraciones:
ScaleFree 
ScaleMin 
ScaleMax 
ScaleFree 
ScaleMin 
ScaleMax 

Documentación del constructor y destructor

QSize::QSize ( ) [inline]

Constructs a size with invalid (negative) width and height.

QSize::QSize ( int  w,
int  h 
) [inline]

Constructs a size with width w and height h.

QSize::QSize ( )
QSize::QSize ( int  w,
int  h 
)

Documentación de las funciones miembro

QSize QSize::boundedTo ( const QSize otherSize) const [inline]

Returns a size with the minimum width and height of this size and otherSize.

QSize QSize::boundedTo ( const QSize ) const
QSize QSize::expandedTo ( const QSize otherSize) const [inline]

Returns a size with the maximum width and height of this size and otherSize.

QSize QSize::expandedTo ( const QSize ) const
int QSize::height ( ) const [inline]

Returns the height.

Ver también:
width()
int QSize::height ( ) const
bool QSize::isEmpty ( void  ) const [inline]

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.

bool QSize::isEmpty ( ) const
bool QSize::isNull ( ) const
bool QSize::isNull ( ) const [inline]

Returns TRUE if the width is 0 and the height is 0; otherwise returns FALSE.

bool QSize::isValid ( ) const
bool QSize::isValid ( void  ) const [inline]

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.

QSize & QSize::operator*= ( int  c) [inline]

Multiplies both the width and height by c and returns a reference to the size.

QSize & QSize::operator*= ( double  c) [inline]
QSize& QSize::operator*= ( int  c)
QSize& QSize::operator*= ( double  c)
QSize& QSize::operator+= ( const QSize )
QSize & QSize::operator+= ( const QSize s) [inline]

Adds s to the size and returns a reference to this size.

Example:

    QSize s(  3, 7 );
    QSize r( -1, 4 );
    s += r;                     // s becomes (2,11)
QSize & QSize::operator-= ( const QSize s) [inline]

Subtracts s from the size and returns a reference to this size.

Example:

    QSize s(  3, 7 );
    QSize r( -1, 4 );
    s -= r;                     // s becomes (4,3)
QSize& QSize::operator-= ( const QSize )
QSize& QSize::operator/= ( double  c)
QSize & QSize::operator/= ( double  c) [inline]

Esta es una función miembro sobrecargada que se suministra por conveniencia. Difiere de la anterior función solamente en los argumentos que acepta. Divides both the width and height by c and returns a reference to the size.

Note that the result is truncated.

QSize & QSize::operator/= ( int  c) [inline]

Divides both the width and height by c and returns a reference to the size.

QSize& QSize::operator/= ( int  c)
QCOORD& QSize::rheight ( )
QCOORD & QSize::rheight ( ) [inline]

Returns a reference to the height.

Using a reference makes it possible to directly manipulate the height.

Example:

    QSize s( 100, 10 );
    s.rheight() += 5;           // s becomes (100,15)
Ver también:
rwidth()
QCOORD& QSize::rwidth ( )
QCOORD & QSize::rwidth ( ) [inline]

Returns a reference to the width.

Using a reference makes it possible to directly manipulate the width.

Example:

    QSize s( 100, 10 );
    s.rwidth() += 20;           // s becomes (120,10)
Ver también:
rheight()
void QSize::scale ( const QSize s,
ScaleMode  mode 
)
void QSize::scale ( const QSize s,
ScaleMode  mode 
)

Esta es una función miembro sobrecargada que se suministra por conveniencia. Difiere de la anterior función solamente en los argumentos que acepta. Equivalent to scale({s}.width(), {s}.height(), mode).

void QSize::scale ( int  w,
int  h,
ScaleMode  mode 
)

Scales the size to a rectangle of width w and height h according to the ScaleMode mode.

If mode is ScaleFree, the size is set to (w, h). If mode is ScaleMin, the current size is scaled to a rectangle as large as possible inside (w, h), preserving the aspect ratio. If mode is ScaleMax, the current size is scaled to a rectangle as small as possible outside (w, h), preserving the aspect ratio.

Example:

    QSize t1( 10, 12 );
    t1.scale( 60, 60, QSize::ScaleFree );
    // t1 is (60, 60)

    QSize t2( 10, 12 );
    t2.scale( 60, 60, QSize::ScaleMin );
    // t2 is (50, 60)

    QSize t3( 10, 12 );
    t3.scale( 60, 60, QSize::ScaleMax );
    // t3 is (60, 72)
void QSize::scale ( int  w,
int  h,
ScaleMode  mode 
)
void QSize::setHeight ( int  h)
void QSize::setHeight ( int  h) [inline]

Sets the height to h.

Ver también:
height(), setWidth()
void QSize::setWidth ( int  w)
void QSize::setWidth ( int  w) [inline]

Sets the width to w.

Ver también:
width(), setHeight()
void QSize::transpose ( )
void QSize::transpose ( )

Swaps the values of width and height.

int QSize::width ( ) const
int QSize::width ( ) const [inline]

Returns the width.

Ver también:
height()

Documentación de las funciones relacionadas y clases amigas

const QSize operator [related]

Multiplies s by c and returns the result.

const QSize operator [related]

Multiplies s by c and returns the result.

const QSize operator [related]

Multiplies s by c and returns the result.

bool operator!= ( const QSize s1,
const QSize s2 
) [friend]

Returns TRUE if s1 and s2 are different; otherwise returns FALSE.

bool operator!= ( const QSize s1,
const QSize s2 
) [friend]
const QSize operator* ( double  c,
const QSize s 
) [friend]
const QSize operator* ( int  c,
const QSize s 
) [friend]
const QSize operator* ( const QSize s,
double  c 
) [friend]
const QSize operator* ( double  c,
const QSize s 
) [friend]
const QSize operator* ( const QSize s,
int  c 
) [friend]

Multiplies s by c and returns the result.

const QSize operator* ( int  c,
const QSize s 
) [friend]
const QSize operator* ( const QSize s,
double  c 
) [friend]
const QSize operator* ( const QSize s,
int  c 
) [friend]
const QSize operator+ ( const QSize s1,
const QSize s2 
) [friend]

Returns the sum of s1 and s2; each component is added separately.

const QSize operator+ ( const QSize s1,
const QSize s2 
) [friend]
const QSize operator- ( const QSize s1,
const QSize s2 
) [friend]

Returns s2 subtracted from s1; each component is subtracted separately.

const QSize operator- ( const QSize s1,
const QSize s2 
) [friend]
const QSize operator/ ( const QSize s,
double  c 
) [friend]
const QSize operator/ ( const QSize s,
int  c 
) [friend]
const QSize operator/ ( const QSize s,
double  c 
) [friend]

Esta es una función miembro sobrecargada que se suministra por conveniencia. Difiere de la anterior función solamente en los argumentos que acepta. Divides s by c and returns the result.

Note that the result is truncated.

const QSize operator/ ( const QSize s,
int  c 
) [friend]

Divides s by c and returns the result.

QDataStream & operator<< ( QDataStream s,
const QSize sz 
) [related]

Writes the size sz to the stream s and returns a reference to the stream.

Ver también:
Format of the QDataStream operators
bool operator== ( const QSize s1,
const QSize s2 
) [friend]
bool operator== ( const QSize s1,
const QSize s2 
) [friend]

Returns TRUE if s1 and s2 are equal; otherwise returns FALSE.

QDataStream & operator>> ( QDataStream s,
QSize sz 
) [related]

Reads the size from the stream s into size sz and returns a reference to the stream.

Ver también:
Format of the QDataStream operators

La documentación para esta clase fue generada a partir de los siguientes ficheros:
 Todo Clases Namespaces Archivos Funciones Variables 'typedefs' Enumeraciones Valores de enumeraciones Propiedades Amigas 'defines'