Public Member Functions | Friends

QRectF Class Reference

Search for all occurrences

Detailed Description

Definition at line 511 of file qrect.h.

#include <qrect.h>

List of all members.

Public Member Functions

  QRectF ()
  QRectF (const QPointF &topleft, const QSizeF &size)
  QRectF (const QPointF &topleft, const QPointF &bottomRight)
  QRectF (qreal left, qreal top, qreal width, qreal height)
  QRectF (const QRect &rect)
bool  isNull () const
bool  isEmpty () const
bool  isValid () const
QRectF  normalized () const
qreal  left () const
qreal  top () const
qreal  right () const
qreal  bottom () const
qreal  x () const
qreal  y () const
void  setLeft (qreal pos)
void  setTop (qreal pos)
void  setRight (qreal pos)
void  setBottom (qreal pos)
void  setX (qreal pos)
void  setY (qreal pos)
QPointF  topLeft () const
QPointF  bottomRight () const
QPointF  topRight () const
QPointF  bottomLeft () const
QPointF  center () const
void  setTopLeft (const QPointF &p)
void  setBottomRight (const QPointF &p)
void  setTopRight (const QPointF &p)
void  setBottomLeft (const QPointF &p)
void  moveLeft (qreal pos)
void  moveTop (qreal pos)
void  moveRight (qreal pos)
void  moveBottom (qreal pos)
void  moveTopLeft (const QPointF &p)
void  moveBottomRight (const QPointF &p)
void  moveTopRight (const QPointF &p)
void  moveBottomLeft (const QPointF &p)
void  moveCenter (const QPointF &p)
void  translate (qreal dx, qreal dy)
void  translate (const QPointF &p)
QRectF  translated (qreal dx, qreal dy) const
QRectF  translated (const QPointF &p) const
void  moveTo (qreal x, qreal t)
void  moveTo (const QPointF &p)
void  setRect (qreal x, qreal y, qreal w, qreal h)
void  getRect (qreal *x, qreal *y, qreal *w, qreal *h) const
void  setCoords (qreal x1, qreal y1, qreal x2, qreal y2)
void  getCoords (qreal *x1, qreal *y1, qreal *x2, qreal *y2) const
void  adjust (qreal x1, qreal y1, qreal x2, qreal y2)
QRectF  adjusted (qreal x1, qreal y1, qreal x2, qreal y2) const
QSizeF  size () const
qreal  width () const
qreal  height () const
void  setWidth (qreal w)
void  setHeight (qreal h)
void  setSize (const QSizeF &s)
QRectF  operator| (const QRectF &r) const
QRectF  operator& (const QRectF &r) const
QRectF operator|= (const QRectF &r)
QRectF operator&= (const QRectF &r)
bool  contains (const QPointF &p) const
bool  contains (qreal x, qreal y) const
bool  contains (const QRectF &r) const
QRectF  unite (const QRectF &r) const
QRectF  united (const QRectF &other) const
QRectF  intersect (const QRectF &r) const
QRectF  intersected (const QRectF &other) const
bool  intersects (const QRectF &r) const
QRect  toRect () const
QRect  toAlignedRect () const

Friends

Q_CORE_EXPORT_INLINE bool  operator== (const QRectF &, const QRectF &)
Q_CORE_EXPORT_INLINE bool  operator!= (const QRectF &, const QRectF &)

Constructor & Destructor Documentation

QRectF ( ) [inline]

Definition at line 514 of file qrect.h.

{ xp = yp = 0.; w = h = 0.; }
QRectF ( const QPointF topleft,
const QSizeF size 
) [inline]

Definition at line 634 of file qrect.h.

{
    xp = atopLeft.x();
    yp = atopLeft.y();
    w = asize.width();
    h = asize.height();
}
QRectF ( const QPointF topleft,
const QPointF bottomRight 
) [inline]

Definition at line 642 of file qrect.h.

{
    xp = atopLeft.x();
    yp = atopLeft.y();
    w = abottomRight.x() - xp;
    h = abottomRight.y() - yp;
}
QRectF ( qreal  left,
qreal  top,
qreal  width,
qreal  height 
) [inline]

Definition at line 629 of file qrect.h.

    : xp(aleft), yp(atop), w(awidth), h(aheight)
{
}
QRectF ( const QRect rect ) [inline]

Definition at line 650 of file qrect.h.

    : xp(r.x()), yp(r.y()), w(r.width()), h(r.height())
{
}

Member Function Documentation

bool isNull ( ) const [inline]

Definition at line 655 of file qrect.h.

{ return w == 0. && h == 0.; }
bool isEmpty ( ) const [inline]

Definition at line 658 of file qrect.h.

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

Definition at line 661 of file qrect.h.

{ return w > 0. && h > 0.; }
QRectF normalized ( ) const
qreal left ( ) const [inline]

Definition at line 525 of file qrect.h.

{ return xp; }
qreal top ( ) const [inline]

Definition at line 526 of file qrect.h.

{ return yp; }
qreal right ( ) const [inline]

Definition at line 527 of file qrect.h.

{ return xp + w; }
qreal bottom ( ) const [inline]

Definition at line 528 of file qrect.h.

{ return yp + h; }
qreal x ( ) const [inline]

Definition at line 664 of file qrect.h.

{ return xp; }
qreal y ( ) const [inline]

Definition at line 667 of file qrect.h.

{ return yp; }
void setLeft ( qreal  pos ) [inline]

Definition at line 670 of file qrect.h.

{ qreal diff = pos - xp; xp += diff; w -= diff; }
void setTop ( qreal  pos ) [inline]

Definition at line 674 of file qrect.h.

{ qreal diff = pos - yp; yp += diff; h -= diff; }
void setRight ( qreal  pos ) [inline]

Definition at line 672 of file qrect.h.

{ w = pos - xp; }
void setBottom ( qreal  pos ) [inline]

Definition at line 676 of file qrect.h.

{ h = pos - yp; }
void setX ( qreal  pos ) [inline]

Definition at line 536 of file qrect.h.

{ setLeft(pos); }
void setY ( qreal  pos ) [inline]

Definition at line 537 of file qrect.h.

{ setTop(pos); }
QPointF topLeft ( ) const [inline]

Definition at line 539 of file qrect.h.

{ return QPointF(xp, yp); }
QPointF bottomRight ( ) const [inline]

Definition at line 540 of file qrect.h.

{ return QPointF(xp+w, yp+h); }
QPointF topRight ( ) const [inline]

Definition at line 541 of file qrect.h.

{ return QPointF(xp+w, yp); }
QPointF bottomLeft ( ) const [inline]

Definition at line 542 of file qrect.h.

{ return QPointF(xp, yp+h); }
QPointF center ( ) const [inline]

Definition at line 686 of file qrect.h.

{ return QPointF(xp + w/2, yp + h/2); }
void setTopLeft ( const QPointF p ) [inline]

Definition at line 678 of file qrect.h.

{ setLeft(p.x()); setTop(p.y()); }
void setBottomRight ( const QPointF p ) [inline]

Definition at line 684 of file qrect.h.

{ setRight(p.x()); setBottom(p.y()); }
void setTopRight ( const QPointF p ) [inline]

Definition at line 680 of file qrect.h.

{ setRight(p.x()); setTop(p.y()); }
void setBottomLeft ( const QPointF p ) [inline]

Definition at line 682 of file qrect.h.

{ setLeft(p.x()); setBottom(p.y()); }
void moveLeft ( qreal  pos ) [inline]

Definition at line 689 of file qrect.h.

{ xp = pos; }
void moveTop ( qreal  pos ) [inline]

Definition at line 691 of file qrect.h.

{ yp = pos; }
void moveRight ( qreal  pos ) [inline]

Definition at line 693 of file qrect.h.

{ xp = pos - w; }
void moveBottom ( qreal  pos ) [inline]

Definition at line 695 of file qrect.h.

{ yp = pos - h; }
void moveTopLeft ( const QPointF p ) [inline]

Definition at line 697 of file qrect.h.

{ moveLeft(p.x()); moveTop(p.y()); }
void moveBottomRight ( const QPointF p ) [inline]

Definition at line 703 of file qrect.h.

{ moveRight(p.x()); moveBottom(p.y()); }
void moveTopRight ( const QPointF p ) [inline]

Definition at line 699 of file qrect.h.

{ moveRight(p.x()); moveTop(p.y()); }
void moveBottomLeft ( const QPointF p ) [inline]

Definition at line 701 of file qrect.h.

{ moveLeft(p.x()); moveBottom(p.y()); }
void moveCenter ( const QPointF p ) [inline]

Definition at line 705 of file qrect.h.

{ xp = p.x() - w/2; yp = p.y() - h/2; }
void translate ( qreal  dx,
qreal  dy 
) [inline]

Definition at line 716 of file qrect.h.

{
    xp += dx;
    yp += dy;
}
void translate ( const QPointF p ) [inline]

Definition at line 722 of file qrect.h.

{
    xp += p.x();
    yp += p.y();
}
QRectF translated ( qreal  dx,
qreal  dy 
) const [inline]

Definition at line 740 of file qrect.h.

{ return QRectF(xp + dx, yp + dy, w, h); }
QRectF translated ( const QPointF p ) const [inline]

Definition at line 743 of file qrect.h.

{ return QRectF(xp + p.x(), yp + p.y(), w, h); }
void moveTo ( qreal  x,
qreal  t 
) [inline]

Definition at line 728 of file qrect.h.

{
    xp = ax;
    yp = ay;
}
void moveTo ( const QPointF p ) [inline]

Definition at line 734 of file qrect.h.

{
    xp = p.x();
    yp = p.y();
}
void setRect ( qreal  x,
qreal  y,
qreal  w,
qreal  h 
) [inline]

Definition at line 754 of file qrect.h.

{
    this->xp = ax;
    this->yp = ay;
    this->w = aaw;
    this->h = aah;
}
void getRect ( qreal *  x,
qreal *  y,
qreal *  w,
qreal *  h 
) const [inline]

Definition at line 746 of file qrect.h.

{
    *ax = this->xp;
    *ay = this->yp;
    *aaw = this->w;
    *aah = this->h;
}
void setCoords ( qreal  x1,
qreal  y1,
qreal  x2,
qreal  y2 
) [inline]

Definition at line 770 of file qrect.h.

{
    xp = xp1;
    yp = yp1;
    w = xp2 - xp1;
    h = yp2 - yp1;
}
void getCoords ( qreal *  x1,
qreal *  y1,
qreal *  x2,
qreal *  y2 
) const [inline]

Definition at line 762 of file qrect.h.

{
    *xp1 = xp;
    *yp1 = yp;
    *xp2 = xp + w;
    *yp2 = yp + h;
}
void adjust ( qreal  x1,
qreal  y1,
qreal  x2,
qreal  y2 
) [inline]

Definition at line 778 of file qrect.h.

{ xp += xp1; yp += yp1; w += xp2 - xp1; h += yp2 - yp1; }
QRectF adjusted ( qreal  x1,
qreal  y1,
qreal  x2,
qreal  y2 
) const [inline]

Definition at line 781 of file qrect.h.

{ return QRectF(xp + xp1, yp + yp1, w + xp2 - xp1, h + yp2 - yp1); }
QSizeF size ( ) const [inline]

Definition at line 713 of file qrect.h.

{ return QSizeF(w, h); }
qreal width ( ) const [inline]

Definition at line 707 of file qrect.h.

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

Definition at line 710 of file qrect.h.

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

Definition at line 784 of file qrect.h.

{ this->w = aw; }
void setHeight ( qreal  h ) [inline]

Definition at line 787 of file qrect.h.

{ this->h = ah; }
void setSize ( const QSizeF s ) [inline]

Definition at line 790 of file qrect.h.

{
    w = s.width();
    h = s.height();
}
QRectF operator| ( const QRectF r ) const
QRectF operator& ( const QRectF r ) const
QRectF & operator|= ( const QRectF r ) [inline]

Definition at line 801 of file qrect.h.

{
    *this = *this | r;
    return *this;
}
QRectF & operator&= ( const QRectF r ) [inline]

Definition at line 807 of file qrect.h.

{
    *this = *this & r;
    return *this;
}
bool contains ( const QPointF p ) const
bool contains ( qreal  x,
qreal  y 
) const [inline]

Definition at line 796 of file qrect.h.

{
    return contains(QPointF(ax, ay));
}
bool contains ( const QRectF r ) const
QRectF unite ( const QRectF r ) const [inline]

Definition at line 823 of file qrect.h.

{
    return *this | r;
}
QRectF united ( const QRectF other ) const [inline]

Definition at line 828 of file qrect.h.

{
    return unite(r);
}
QRectF intersect ( const QRectF r ) const [inline]

Definition at line 813 of file qrect.h.

{
    return *this & r;
}
QRectF intersected ( const QRectF other ) const [inline]

Definition at line 818 of file qrect.h.

{
    return intersect(r);
}
bool intersects ( const QRectF r ) const
QRect toRect ( ) const [inline]

Definition at line 845 of file qrect.h.

{
    return QRect(qRound(xp), qRound(yp), qRound(w), qRound(h));
}
QRect toAlignedRect ( ) const

Friends And Related Function Documentation

Q_CORE_EXPORT_INLINE bool operator== ( const QRectF r1,
const QRectF r2 
) [friend]
Q_CORE_EXPORT_INLINE bool operator!= ( const QRectF r1,
const QRectF r2 
) [friend]

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

QRectF QRectF QRectF QRectF QRectF QRectF QRectF QRectF QRectF QRectF
QRectF QRectF QRectF QRectF QRectF QRectF QRectF QRectF QRectF QRectF