45 #include <QtCore/qpoint.h> 46 #include <QtCore/qmetatype.h> 58 #ifndef QT_NO_VECTOR2D 67 #ifndef QT_NO_VECTOR3D 70 #ifndef QT_NO_VECTOR4D 83 qreal lengthSquared()
const;
108 #ifndef QT_NO_VECTOR3D 111 #ifndef QT_NO_VECTOR4D 123 QVector2D(
float xpos,
float ypos,
int dummy);
189 return v1.
xp == v2.
xp && v1.
yp == v2.
yp;
194 return v1.
xp != v2.
xp || v1.
yp != v2.
yp;
229 return QVector2D(vector.
xp / divisor, vector.
yp / divisor, 1);
247 #ifndef QT_NO_DEBUG_STREAM 251 #ifndef QT_NO_DATASTREAM The QVariant class acts like a union for the most common Qt data types.
The QDebug class provides an output stream for debugging information.
const QVector2D operator-(const QVector2D &v1, const QVector2D &v2)
QVector2D & operator*=(qreal factor)
Multiplies this vector's coordinates by the given factor, and returns a reference to this vector...
The QVector3D class represents a vector or vertex in 3D space.
friend const QVector2D operator+(const QVector2D &v1, const QVector2D &v2)
Returns a QVector2D object that is the sum of the given vectors, v1 and v2; each component is added s...
#define QT_END_NAMESPACE
This macro expands to.
QPoint toPoint() const
Returns the QPoint form of this 2D vector.
friend bool operator!=(const QVector2D &v1, const QVector2D &v2)
Returns true if v1 is not equal to v2; otherwise returns false.
The QVector4D class represents a vector or vertex in 4D space.
The QPointF class defines a point in the plane using floating point precision.
QVector2D & operator/=(qreal divisor)
Divides this vector's coordinates by the given divisor, and returns a reference to this vector...
friend bool operator==(const QVector2D &v1, const QVector2D &v2)
Returns true if v1 is equal to v2; otherwise returns false.
static bool qIsNull(double d)
void setX(qreal x)
Sets the x coordinate of this point to the given x coordinate.
friend const QVector2D operator/(const QVector2D &vector, qreal divisor)
Returns the QVector2D object formed by dividing all three components of the given vector by the given...
bool operator==(const QVector2D &v1, const QVector2D &v2)
#define QT_BEGIN_NAMESPACE
This macro expands to.
QDataStream & operator>>(QDataStream &stream, QVector2D &vector)
Reads a 2D vector from the given stream into the given vector and returns a reference to the stream...
Q_DECLARE_TYPEINFO(QVector2D, Q_MOVABLE_TYPE)
The QVector2D class represents a vector or vertex in 2D space.
qreal x() const
Returns the x coordinate of this point.
void setY(qreal y)
Sets the y coordinate of this point to the given y coordinate.
const QVector2D operator+(const QVector2D &v1, const QVector2D &v2)
QVector2D & operator-=(const QVector2D &vector)
Subtracts the given vector from this vector and returns a reference to this vector.
bool operator!=(const QVector2D &v1, const QVector2D &v2)
QDataStream & operator<<(QDataStream &stream, const QVector2D &vector)
Writes the given vector to the given stream and returns a reference to the stream.
const QVector2D operator/(const QVector2D &vector, qreal divisor)
friend const QVector2D operator*(qreal factor, const QVector2D &vector)
bool qFuzzyCompare(const QVector2D &v1, const QVector2D &v2)
The QPoint class defines a point in the plane using integer precision.
bool isNull() const
Returns true if the x and y coordinates are set to 0.
QPointF toPointF() const
Returns the QPointF form of this 2D vector.
qreal y() const
Returns the y coordinate of this point.
const QVector2D operator*(qreal factor, const QVector2D &vector)
friend bool qFuzzyCompare(const QVector2D &v1, const QVector2D &v2)
Returns true if v1 and v2 are equal, allowing for a small fuzziness factor for floating-point compari...
The QDataStream class provides serialization of binary data to a QIODevice.
friend const QVector2D operator-(const QVector2D &v1, const QVector2D &v2)
Returns a QVector2D object that is formed by subtracting v2 from v1; each component is subtracted sep...
timeval & operator+=(timeval &t1, const timeval &t2)
static void normalize(double &x, double &y)
Q_DECL_CONSTEXPR int qRound(qreal d)
static bool isNull(const QVariant::Private *d)
QVector2D()
Constructs a null vector, i.
QVector2D & operator+=(const QVector2D &vector)
Adds the given vector to this vector and returns a reference to this vector.