45 #include <QtCore/qnamespace.h> 57 QPoint(
int xpos,
int ypos);
66 int manhattanLength()
const;
72 QPoint &operator-=(
const QPoint &p);
74 QPoint &operator*=(
float c);
75 QPoint &operator*=(
double c);
76 QPoint &operator*=(
int c);
78 QPoint &operator/=(
qreal c);
80 friend inline bool operator==(
const QPoint &,
const QPoint &);
81 friend inline bool operator!=(
const QPoint &,
const QPoint &);
82 friend inline const QPoint
operator+(
const QPoint &,
const QPoint &);
83 friend inline const QPoint
operator-(
const QPoint &,
const QPoint &);
84 friend inline const QPoint
operator*(
const QPoint &,
float);
85 friend inline const QPoint
operator*(
float,
const QPoint &);
86 friend inline const QPoint
operator*(
const QPoint &,
double);
87 friend inline const QPoint
operator*(
double,
const QPoint &);
88 friend inline const QPoint
operator*(
const QPoint &,
int);
89 friend inline const QPoint
operator*(
int,
const QPoint &);
90 friend inline const QPoint
operator-(
const QPoint &);
96 #if defined(Q_OS_MAC) && !defined(Q_OS_IOS) 110 #ifndef QT_NO_DATASTREAM 123 {
xp = xpos;
yp = ypos; }
126 {
return xp == 0 &&
yp == 0; }
147 {
xp+=p.
xp;
yp+=p.
yp;
return *
this; }
150 {
xp-=p.
xp;
yp-=p.
yp;
return *
this; }
162 {
return p1.
xp == p2.
xp && p1.
yp == p2.
yp; }
165 {
return p1.
xp != p2.
xp || p1.
yp != p2.
yp; }
206 #ifndef QT_NO_DEBUG_STREAM 262 #ifndef QT_NO_DATASTREAM 326 xp*=
c;
yp*=
c;
return *
this;
381 #ifndef QT_NO_DEBUG_STREAM The QDebug class provides an output stream for debugging information.
QPoint & operator*=(float c)
QPointF & operator+=(const QPointF &p)
Adds the given point to this point and returns a reference to this point.
QPointF & operator/=(qreal c)
Divides both x and y by the given divisor, and returns a reference to this point. ...
#define QT_END_NAMESPACE
This macro expands to.
friend const QPoint operator*(const QPoint &, float)
The QMatrix class specifies 2D transformations of a coordinate system.
friend const QPointF operator*(qreal, const QPointF &)
void setY(qreal y)
Sets the y coordinate of this point to the given y coordinate.
friend const QPointF operator-(const QPointF &, const QPointF &)
Returns a QPointF object that is formed by subtracting p2 from p1; each component is subtracted separ...
The QPointF class defines a point in the plane using floating point precision.
QDataStream & operator<<(QDataStream &stream, const QPointF &point)
Writes the given point to the given stream and returns a reference to the stream. ...
friend const QPoint operator-(const QPoint &, const QPoint &)
Returns a QPoint object that is formed by subtracting p2 from p1; each component is subtracted separa...
int & ry()
Returns a reference to the y coordinate of this point.
friend const QPoint operator/(const QPoint &, qreal)
Returns the QPoint formed by dividing both components of the given point by the given divisor...
friend bool operator!=(const QPointF &, const QPointF &)
Returns true if p1 is not equal to p2; otherwise returns false.
static bool qIsNull(double d)
friend const QPoint operator+(const QPoint &, const QPoint &)
Returns a QPoint object that is the sum of the given points, p1 and p2; each component is added separ...
QPoint()
Constructs a null point, i.
const QByteArray operator+(const QByteArray &a1, const QByteArray &a2)
Returns a byte array that is the result of concatenating byte array a1 and byte array a2...
qreal x() const
Returns the x-coordinate of this point.
QDataStream & operator<<(QDataStream &stream, const QPoint &point)
Writes the given point to the given stream and returns a reference to the stream. ...
#define QT_BEGIN_NAMESPACE
This macro expands to.
qreal & rx()
Returns a reference to the x coordinate of this point.
int manhattanLength() const
Returns the sum of the absolute values of x() and y(), traditionally known as the "Manhattan length" ...
bool isNull() const
Returns true if both the x and y coordinates are set to 0, otherwise returns false.
int & rx()
Returns a reference to the x coordinate of this point.
friend const QPointF operator+(const QPointF &, const QPointF &)
Returns a QPointF object that is the sum of the given points, p1 and p2; each component is added sepa...
QPointF & operator-=(const QPointF &p)
Subtracts the given point from this point and returns a reference to this point.
QDataStream & operator>>(QDataStream &stream, QPoint &point)
Reads a point from the given stream into the given point and returns a reference to the stream...
bool operator!=(const T *o, const QPointer< T > &p)
QPointF()
Constructs a null point, i.
void setY(int y)
Sets the y coordinate of this point to the given y coordinate.
QPointF & operator*=(qreal c)
Multiplies this point's coordinates by the given factor, and returns a reference to this point...
QPoint toPoint() const
Rounds the coordinates of this point to the nearest integer, and returns a QPoint object with the rou...
QPoint & operator-=(const QPoint &p)
Subtracts the given point from this point and returns a reference to this point.
The QPoint class defines a point in the plane using integer precision.
QGenericMatrix< N, M, T > operator/(const QGenericMatrix< N, M, T > &matrix, T divisor)
Returns the result of dividing all elements of matrix by divisor.
friend bool operator!=(const QPoint &, const QPoint &)
Returns true if p1 and p2 are not equal; otherwise returns false.
bool isNull() const
Returns true if both the x and y coordinates are set to +0.
friend bool operator==(const QPoint &, const QPoint &)
Returns true if p1 and p2 are equal; otherwise returns false.
bool operator==(const T *o, const QPointer< T > &p)
qreal & ry()
Returns a reference to the y coordinate of this point.
int y() const
Returns the y coordinate of this point.
void setX(qreal x)
Sets the x coordinate of this point to the given x coordinate.
qreal y() const
Returns the y-coordinate of this point.
static Q_DECL_CONSTEXPR bool qFuzzyIsNull(double d)
QGenericMatrix< M1, M2, T > operator*(const QGenericMatrix< N, M2, T > &m1, const QGenericMatrix< M1, N, T > &m2)
QPoint & operator+=(const QPoint &p)
Adds the given point to this point and returns a reference to this point.
The QDataStream class provides serialization of binary data to a QIODevice.
int x() const
Returns the x coordinate of this point.
friend const QPointF operator/(const QPointF &, qreal)
Returns the QPointF object formed by dividing both components of the given point by the given divisor...
timeval & operator+=(timeval &t1, const timeval &t2)
void setX(int x)
Sets the x coordinate of this point to the given x coordinate.
QDataStream & operator<<(QDataStream &out, const QUrl &url)
Writes url url to the stream out and returns a reference to the stream.
Q_DECL_CONSTEXPR int qRound(qreal d)
QPoint & operator/=(qreal c)
This is an overloaded member function, provided for convenience. It differs from the above function o...
friend bool operator==(const QPointF &, const QPointF &)
Returns true if p1 is equal to p2; otherwise returns false.
static bool isNull(const QVariant::Private *d)
Q_DECLARE_TYPEINFO(QPoint, Q_MOVABLE_TYPE)
QDataStream & operator>>(QDataStream &in, QUrl &url)
Reads a url into url from the stream in and returns a reference to the stream.
QGenericMatrix< N, M, T > operator-(const QGenericMatrix< N, M, T > &m1, const QGenericMatrix< N, M, T > &m2)
Returns the difference of m1 and m2.