Public Member Functions | Friends

QSize Class Reference

Search for all occurrences

Detailed Description

Definition at line 53 of file qsize.h.

#include <qsize.h>

List of all members.

Public Member Functions

  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, Qt::AspectRatioMode mode)
void  scale (const QSize &s, Qt::AspectRatioMode mode)
QSize  expandedTo (const QSize &) const
QSize  boundedTo (const QSize &) const
int &  rwidth ()
int &  rheight ()
QSize operator+= (const QSize &)
QSize operator-= (const QSize &)
QSize operator*= (qreal c)
QSize operator/= (qreal c)

Friends

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 &, qreal)
const QSize  operator* (qreal, const QSize &)
const QSize  operator/ (const QSize &, qreal)

Constructor & Destructor Documentation

QSize ( ) [inline]

Definition at line 111 of file qsize.h.

{ wd = ht = -1; }
QSize ( int  w,
int  h 
) [inline]

Definition at line 114 of file qsize.h.

{ wd = w; ht = h; }

Member Function Documentation

bool isNull ( ) const [inline]

Definition at line 117 of file qsize.h.

{ return wd==0 && ht==0; }
bool isEmpty ( ) const [inline]

Definition at line 120 of file qsize.h.

{ return wd<1 || ht<1; }
bool isValid ( ) const [inline]

Definition at line 123 of file qsize.h.

{ return wd>=0 && ht>=0; }
int width ( ) const [inline]
Examples:
MeshDisplace/displacer.cpp.

Definition at line 126 of file qsize.h.

{ return wd; }
int height ( ) const [inline]
Examples:
MeshDisplace/displacer.cpp.

Definition at line 129 of file qsize.h.

{ return ht; }
void setWidth ( int  w ) [inline]

Definition at line 132 of file qsize.h.

{ wd = w; }
void setHeight ( int  h ) [inline]

Definition at line 135 of file qsize.h.

{ ht = h; }
void transpose ( )
void scale ( int  w,
int  h,
Qt::AspectRatioMode  mode 
) [inline]

Definition at line 138 of file qsize.h.

{ scale(QSize(w, h), mode); }
void scale ( const QSize s,
Qt::AspectRatioMode  mode 
)
QSize expandedTo ( const QSize otherSize ) const [inline]

Definition at line 187 of file qsize.h.

{
    return QSize(qMax(wd,otherSize.wd), qMax(ht,otherSize.ht));
}
QSize boundedTo ( const QSize otherSize ) const [inline]

Definition at line 192 of file qsize.h.

{
    return QSize(qMin(wd,otherSize.wd), qMin(ht,otherSize.ht));
}
int & rwidth ( ) [inline]

Definition at line 141 of file qsize.h.

{ return wd; }
int & rheight ( ) [inline]

Definition at line 144 of file qsize.h.

{ return ht; }
QSize & operator+= ( const QSize s ) [inline]

Definition at line 147 of file qsize.h.

{ wd+=s.wd; ht+=s.ht; return *this; }
QSize & operator-= ( const QSize s ) [inline]

Definition at line 150 of file qsize.h.

{ wd-=s.wd; ht-=s.ht; return *this; }
QSize & operator*= ( qreal  c ) [inline]

Definition at line 153 of file qsize.h.

{ wd = qRound(wd*c); ht = qRound(ht*c); return *this; }
QSize & operator/= ( qreal  c ) [inline]

Definition at line 174 of file qsize.h.

{
    Q_ASSERT(!qFuzzyIsNull(c));
    wd = qRound(wd/c); ht = qRound(ht/c);
    return *this;
}

Friends And Related Function Documentation

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

Definition at line 156 of file qsize.h.

{ return s1.wd == s2.wd && s1.ht == s2.ht; }
bool operator!= ( const QSize s1,
const QSize s2 
) [friend]

Definition at line 159 of file qsize.h.

{ return s1.wd != s2.wd || s1.ht != s2.ht; }
const QSize operator+ ( const QSize s1,
const QSize s2 
) [friend]

Definition at line 162 of file qsize.h.

{ return QSize(s1.wd+s2.wd, s1.ht+s2.ht); }
const QSize operator- ( const QSize s1,
const QSize s2 
) [friend]

Definition at line 165 of file qsize.h.

{ return QSize(s1.wd-s2.wd, s1.ht-s2.ht); }
const QSize operator* ( const QSize s,
qreal  c 
) [friend]

Definition at line 168 of file qsize.h.

{ return QSize(qRound(s.wd*c), qRound(s.ht*c)); }
const QSize operator* ( qreal  c,
const QSize s 
) [friend]

Definition at line 171 of file qsize.h.

{ return QSize(qRound(s.wd*c), qRound(s.ht*c)); }
const QSize operator/ ( const QSize s,
qreal  c 
) [friend]

Definition at line 181 of file qsize.h.

{
    Q_ASSERT(!qFuzzyIsNull(c));
    return QSize(qRound(s.wd/c), qRound(s.ht/c));
}

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

QSize QSize QSize QSize QSize QSize QSize QSize QSize QSize
QSize QSize QSize QSize QSize QSize QSize QSize QSize QSize