Public Member Functions | Friends

QSizeF Class Reference

Search for all occurrences

Detailed Description

Definition at line 202 of file qsize.h.

#include <qsize.h>

List of all members.

Public Member Functions

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

Friends

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

Constructor & Destructor Documentation

QSizeF ( ) [inline]

Definition at line 264 of file qsize.h.

{ wd = ht = -1.; }
QSizeF ( const QSize sz ) [inline]

Definition at line 267 of file qsize.h.

    : wd(sz.width()), ht(sz.height())
{
}
QSizeF ( qreal  w,
qreal  h 
) [inline]

Definition at line 272 of file qsize.h.

{ wd = w; ht = h; }

Member Function Documentation

bool isNull ( ) const [inline]

Definition at line 275 of file qsize.h.

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

Definition at line 278 of file qsize.h.

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

Definition at line 281 of file qsize.h.

{ return wd >= 0. && ht >= 0.; }
qreal width ( ) const [inline]

Definition at line 284 of file qsize.h.

{ return wd; }
qreal height ( ) const [inline]

Definition at line 287 of file qsize.h.

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

Definition at line 290 of file qsize.h.

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

Definition at line 293 of file qsize.h.

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

Definition at line 296 of file qsize.h.

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

Definition at line 345 of file qsize.h.

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

Definition at line 350 of file qsize.h.

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

Definition at line 299 of file qsize.h.

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

Definition at line 302 of file qsize.h.

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

Definition at line 305 of file qsize.h.

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

Definition at line 308 of file qsize.h.

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

Definition at line 311 of file qsize.h.

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

Definition at line 332 of file qsize.h.

{
    Q_ASSERT(!qFuzzyIsNull(c));
    wd = wd/c; ht = ht/c;
    return *this;
}
QSize toSize ( ) const [inline]

Definition at line 355 of file qsize.h.

{
    return QSize(qRound(wd), qRound(ht));
}

Friends And Related Function Documentation

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

Definition at line 314 of file qsize.h.

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

Definition at line 317 of file qsize.h.

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

Definition at line 320 of file qsize.h.

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

Definition at line 323 of file qsize.h.

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

Definition at line 326 of file qsize.h.

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

Definition at line 329 of file qsize.h.

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

Definition at line 339 of file qsize.h.

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

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

QSizeF QSizeF QSizeF QSizeF QSizeF QSizeF QSizeF QSizeF QSizeF QSizeF
QSizeF QSizeF QSizeF QSizeF QSizeF QSizeF QSizeF QSizeF QSizeF QSizeF