Public Member Functions | Friends

QPoint Class Reference

Search for all occurrences

Detailed Description

Definition at line 53 of file qpoint.h.

#include <qpoint.h>

List of all members.

Public Member Functions

  QPoint ()
  QPoint (int xpos, int ypos)
bool  isNull () const
int  x () const
int  y () const
void  setX (int x)
void  setY (int y)
int  manhattanLength () const
int &  rx ()
int &  ry ()
QPoint operator+= (const QPoint &p)
QPoint operator-= (const QPoint &p)
QPoint operator*= (qreal c)
QPoint operator/= (qreal c)

Friends

class  QTransform
bool  operator== (const QPoint &, const QPoint &)
bool  operator!= (const QPoint &, const QPoint &)
const QPoint  operator+ (const QPoint &, const QPoint &)
const QPoint  operator- (const QPoint &, const QPoint &)
const QPoint  operator* (const QPoint &, qreal)
const QPoint  operator* (qreal, const QPoint &)
const QPoint  operator- (const QPoint &)
const QPoint  operator/ (const QPoint &, qreal)

Constructor & Destructor Documentation

QPoint ( ) [inline]

Definition at line 111 of file qpoint.h.

{ xp=0; yp=0; }
QPoint ( int  xpos,
int  ypos 
) [inline]

Definition at line 114 of file qpoint.h.

{ xp = xpos; yp = ypos; }

Member Function Documentation

bool isNull ( ) const [inline]

Definition at line 117 of file qpoint.h.

{ return xp == 0 && yp == 0; }
int x ( ) const [inline]

Definition at line 120 of file qpoint.h.

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

Definition at line 123 of file qpoint.h.

{ return yp; }
void setX ( int  x ) [inline]

Definition at line 126 of file qpoint.h.

{ xp = xpos; }
void setY ( int  y ) [inline]

Definition at line 129 of file qpoint.h.

{ yp = ypos; }
int manhattanLength ( ) const
int & rx ( ) [inline]

Definition at line 132 of file qpoint.h.

{ return xp; }
int & ry ( ) [inline]

Definition at line 135 of file qpoint.h.

{ return yp; }
QPoint & operator+= ( const QPoint p ) [inline]

Definition at line 138 of file qpoint.h.

{ xp+=p.xp; yp+=p.yp; return *this; }
QPoint & operator-= ( const QPoint p ) [inline]

Definition at line 141 of file qpoint.h.

{ xp-=p.xp; yp-=p.yp; return *this; }
QPoint & operator*= ( qreal  c ) [inline]

Definition at line 144 of file qpoint.h.

{ xp = qRound(xp*c); yp = qRound(yp*c); return *this; }
QPoint & operator/= ( qreal  c ) [inline]

Definition at line 168 of file qpoint.h.

{
    xp = qRound(xp/c);
    yp = qRound(yp/c);
    return *this;
}

Friends And Related Function Documentation

friend class QTransform [friend]

Definition at line 86 of file qpoint.h.

bool operator== ( const QPoint p1,
const QPoint p2 
) [friend]

Definition at line 147 of file qpoint.h.

{ return p1.xp == p2.xp && p1.yp == p2.yp; }
bool operator!= ( const QPoint p1,
const QPoint p2 
) [friend]

Definition at line 150 of file qpoint.h.

{ return p1.xp != p2.xp || p1.yp != p2.yp; }
const QPoint operator+ ( const QPoint p1,
const QPoint p2 
) [friend]

Definition at line 153 of file qpoint.h.

{ return QPoint(p1.xp+p2.xp, p1.yp+p2.yp); }
const QPoint operator- ( const QPoint p1,
const QPoint p2 
) [friend]

Definition at line 156 of file qpoint.h.

{ return QPoint(p1.xp-p2.xp, p1.yp-p2.yp); }
const QPoint operator* ( const QPoint p,
qreal  c 
) [friend]

Definition at line 159 of file qpoint.h.

{ return QPoint(qRound(p.xp*c), qRound(p.yp*c)); }
const QPoint operator* ( qreal  c,
const QPoint p 
) [friend]

Definition at line 162 of file qpoint.h.

{ return QPoint(qRound(p.xp*c), qRound(p.yp*c)); }
const QPoint operator- ( const QPoint p ) [friend]

Definition at line 165 of file qpoint.h.

{ return QPoint(-p.xp, -p.yp); }
const QPoint operator/ ( const QPoint p,
qreal  c 
) [friend]

Definition at line 175 of file qpoint.h.

{
    return QPoint(qRound(p.xp/c), qRound(p.yp/c));
}

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

QPoint QPoint QPoint QPoint QPoint QPoint QPoint QPoint QPoint QPoint
QPoint QPoint QPoint QPoint QPoint QPoint QPoint QPoint QPoint QPoint