QSizeF Class Reference

QSizeF Class Reference

#include <qsize.h>

Class Description

Definition at line 202 of file qsize.h.

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 ()
 
QSizeFoperator+= (const QSizeF &)
 
QSizeFoperator-= (const QSizeF &)
 
QSizeFoperator*= (qreal c)
 
QSizeFoperator/= (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.

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

Definition at line 267 of file qsize.h.

268  : wd(sz.width()), ht(sz.height())
269 {
270 }
int height() const
Definition: qsize.h:129
int width() const
Definition: qsize.h:126
QSizeF ( qreal  w,
qreal  h 
)
inline

Definition at line 272 of file qsize.h.

273 { wd = w; ht = h; }
int int int int int int h
Definition: GLee.h:10534
GLubyte GLubyte GLubyte GLubyte w
Definition: GLee.h:1775

Member Function Documentation

bool isNull ( ) const
inline

Definition at line 275 of file qsize.h.

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

Definition at line 278 of file qsize.h.

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

Definition at line 281 of file qsize.h.

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

Definition at line 284 of file qsize.h.

285 { return wd; }
qreal height ( ) const
inline

Definition at line 287 of file qsize.h.

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

Definition at line 290 of file qsize.h.

291 { wd = w; }
GLubyte GLubyte GLubyte GLubyte w
Definition: GLee.h:1775
void setHeight ( qreal  h)
inline

Definition at line 293 of file qsize.h.

294 { ht = h; }
int int int int int int h
Definition: GLee.h:10534
void scale ( qreal  w,
qreal  h,
Qt::AspectRatioMode  mode 
)
inline

Definition at line 296 of file qsize.h.

297 { scale(QSizeF(w, h), mode); }
GLint mode
Definition: GLee.h:4479
int int int int int int h
Definition: GLee.h:10534
QSizeF()
Definition: qsize.h:264
GLubyte GLubyte GLubyte GLubyte w
Definition: GLee.h:1775
void scale(qreal w, qreal h, Qt::AspectRatioMode mode)
Definition: qsize.h:296
void scale ( const QSizeF s,
Qt::AspectRatioMode  mode 
)
QSizeF expandedTo ( const QSizeF otherSize) const
inline

Definition at line 345 of file qsize.h.

346 {
347  return QSizeF(qMax(wd,otherSize.wd), qMax(ht,otherSize.ht));
348 }
QSizeF()
Definition: qsize.h:264
QSizeF boundedTo ( const QSizeF otherSize) const
inline

Definition at line 350 of file qsize.h.

351 {
352  return QSizeF(qMin(wd,otherSize.wd), qMin(ht,otherSize.ht));
353 }
QSizeF()
Definition: qsize.h:264
qreal & rwidth ( )
inline

Definition at line 299 of file qsize.h.

300 { return wd; }
qreal & rheight ( )
inline

Definition at line 302 of file qsize.h.

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

Definition at line 305 of file qsize.h.

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

Definition at line 308 of file qsize.h.

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

Definition at line 311 of file qsize.h.

312 { wd *= c; ht *= c; return *this; }
const GLubyte * c
Definition: GLee.h:5419
QSizeF & operator/= ( qreal  c)
inline

Definition at line 332 of file qsize.h.

333 {
334  Q_ASSERT(!qFuzzyIsNull(c));
335  wd = wd/c; ht = ht/c;
336  return *this;
337 }
const GLubyte * c
Definition: GLee.h:5419
QSize toSize ( ) const
inline

Definition at line 355 of file qsize.h.

356 {
357  return QSize(qRound(wd), qRound(ht));
358 }
Definition: qsize.h:53

Friends And Related Function Documentation

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

Definition at line 314 of file qsize.h.

315 { return qFuzzyCompare(s1.wd, s2.wd) && qFuzzyCompare(s1.ht, s2.ht); }
bool qFuzzyCompare(const QMatrix &m1, const QMatrix &m2)
Definition: qmatrix.h:172
bool operator!= ( const QSizeF s1,
const QSizeF s2 
)
friend

Definition at line 317 of file qsize.h.

318 { return !qFuzzyCompare(s1.wd, s2.wd) || !qFuzzyCompare(s1.ht, s2.ht); }
bool qFuzzyCompare(const QMatrix &m1, const QMatrix &m2)
Definition: qmatrix.h:172
const QSizeF operator+ ( const QSizeF s1,
const QSizeF s2 
)
friend

Definition at line 320 of file qsize.h.

321 { return QSizeF(s1.wd+s2.wd, s1.ht+s2.ht); }
QSizeF()
Definition: qsize.h:264
const QSizeF operator- ( const QSizeF s1,
const QSizeF s2 
)
friend

Definition at line 323 of file qsize.h.

324 { return QSizeF(s1.wd-s2.wd, s1.ht-s2.ht); }
QSizeF()
Definition: qsize.h:264
const QSizeF operator* ( const QSizeF s,
qreal  c 
)
friend

Definition at line 326 of file qsize.h.

327 { return QSizeF(s.wd*c, s.ht*c); }
const GLubyte * c
Definition: GLee.h:5419
QSizeF()
Definition: qsize.h:264
const QSizeF operator* ( qreal  c,
const QSizeF s 
)
friend

Definition at line 329 of file qsize.h.

330 { return QSizeF(s.wd*c, s.ht*c); }
const GLubyte * c
Definition: GLee.h:5419
QSizeF()
Definition: qsize.h:264
const QSizeF operator/ ( const QSizeF s,
qreal  c 
)
friend

Definition at line 339 of file qsize.h.

340 {
341  Q_ASSERT(!qFuzzyIsNull(c));
342  return QSizeF(s.wd/c, s.ht/c);
343 }
const GLubyte * c
Definition: GLee.h:5419
QSizeF()
Definition: qsize.h:264

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