![]() |
Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
|
#include <qquickvaluetypes_p.h>
Public Member Functions | |
Q_INVOKABLE | QQuickVector2DValueType ()=default |
Q_INVOKABLE | QQuickVector2DValueType (const QVector2D &vector2D) |
Q_INVOKABLE QString | toString () const |
qreal | x () const |
qreal | y () const |
void | setX (qreal) |
void | setY (qreal) |
Q_INVOKABLE qreal | dotProduct (const QVector2D &vec) const |
Q_INVOKABLE QVector2D | times (const QVector2D &vec) const |
Q_INVOKABLE QVector2D | times (qreal scalar) const |
Q_INVOKABLE QVector2D | plus (const QVector2D &vec) const |
Q_INVOKABLE QVector2D | minus (const QVector2D &vec) const |
Q_INVOKABLE QVector2D | normalized () const |
Q_INVOKABLE qreal | length () const |
Q_INVOKABLE QVector3D | toVector3d () const |
Q_INVOKABLE QVector4D | toVector4d () const |
Q_INVOKABLE bool | fuzzyEquals (const QVector2D &vec, qreal epsilon) const |
Q_INVOKABLE bool | fuzzyEquals (const QVector2D &vec) const |
Public Member Functions inherited from QVector2D | |
constexpr | QVector2D () noexcept |
Constructs a null vector, i.e. | |
QVector2D (Qt::Initialization) noexcept | |
constexpr | QVector2D (float xpos, float ypos) noexcept |
Constructs a vector with coordinates (xpos, ypos). | |
constexpr | QVector2D (QPoint point) noexcept |
Constructs a vector with x and y coordinates from a 2D point. | |
constexpr | QVector2D (QPointF point) noexcept |
Constructs a vector with x and y coordinates from a 2D point. | |
constexpr | QVector2D (QVector3D vector) noexcept |
Constructs a vector with x and y coordinates from a 3D vector. | |
constexpr | QVector2D (QVector4D vector) noexcept |
Constructs a vector with x and y coordinates from a 3D vector. | |
constexpr bool | isNull () const noexcept |
Returns true if the x and y coordinates are set to 0.0, otherwise returns false . | |
constexpr float | x () const noexcept |
Returns the x coordinate of this point. | |
constexpr float | y () const noexcept |
Returns the y coordinate of this point. | |
constexpr void | setX (float x) noexcept |
Sets the x coordinate of this point to the given finite x coordinate. | |
constexpr void | setY (float y) noexcept |
Sets the y coordinate of this point to the given finite y coordinate. | |
constexpr float & | operator[] (int i) |
constexpr float | operator[] (int i) const |
float | length () const noexcept |
Returns the length of the vector from the origin. | |
constexpr float | lengthSquared () const noexcept |
Returns the squared length of the vector from the origin. | |
QVector2D | normalized () const noexcept |
Returns the normalized unit vector form of this vector. | |
void | normalize () noexcept |
Normalizes the current vector in place. | |
float | distanceToPoint (QVector2D point) const noexcept |
float | distanceToLine (QVector2D point, QVector2D direction) const noexcept |
constexpr QVector2D & | operator+= (QVector2D vector) noexcept |
Adds the given vector to this vector and returns a reference to this vector. | |
constexpr QVector2D & | operator-= (QVector2D vector) noexcept |
Subtracts the given vector from this vector and returns a reference to this vector. | |
constexpr QVector2D & | operator*= (float factor) noexcept |
Multiplies this vector's coordinates by the given finite factor and returns a reference to this vector. | |
constexpr QVector2D & | operator*= (QVector2D vector) noexcept |
Multiplies each component of this vector by the corresponding component of vector and returns a reference to this vector. | |
constexpr QVector2D & | operator/= (float divisor) |
Divides this vector's coordinates by the given divisor and returns a reference to this vector. | |
constexpr QVector2D & | operator/= (QVector2D vector) |
constexpr QVector3D | toVector3D () const noexcept |
Returns the 3D form of this 2D vector, with the z coordinate set to zero. | |
constexpr QVector4D | toVector4D () const noexcept |
Returns the 4D form of this 2D vector, with the z and w coordinates set to zero. | |
constexpr QPoint | toPoint () const noexcept |
Returns the QPoint form of this 2D vector. | |
constexpr QPointF | toPointF () const noexcept |
Returns the QPointF form of this 2D vector. | |
Q_GUI_EXPORT | operator QVariant () const |
Returns the 2D vector as a QVariant. |
Static Public Member Functions | |
static QVariant | create (const QJSValue ¶ms) |
Static Public Member Functions inherited from QVector2D | |
static constexpr float | dotProduct (QVector2D v1, QVector2D v2) noexcept |
Returns the dot product of v1 and v2. |
Properties | |
qreal | x |
qreal | y |
Additional Inherited Members | |
Related Symbols inherited from QVector2D | |
QDataStream & | operator<< (QDataStream &stream, QVector2D vector) |
Writes the given vector to the given stream and returns a reference to the stream. | |
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. |
Definition at line 90 of file qquickvaluetypes_p.h.
|
default |
|
inline |
Definition at line 105 of file qquickvaluetypes_p.h.
Definition at line 184 of file qquickvaluetypes.cpp.
Definition at line 218 of file qquickvaluetypes.cpp.
bool QQuickVector2DValueType::fuzzyEquals | ( | const QVector2D & | vec | ) | const |
Definition at line 273 of file qquickvaluetypes.cpp.
Definition at line 263 of file qquickvaluetypes.cpp.
qreal QQuickVector2DValueType::length | ( | ) | const |
Definition at line 248 of file qquickvaluetypes.cpp.
Definition at line 238 of file qquickvaluetypes.cpp.
QVector2D QQuickVector2DValueType::normalized | ( | ) | const |
Definition at line 243 of file qquickvaluetypes.cpp.
Definition at line 233 of file qquickvaluetypes.cpp.
Definition at line 208 of file qquickvaluetypes.cpp.
Definition at line 213 of file qquickvaluetypes.cpp.
Definition at line 223 of file qquickvaluetypes.cpp.
Definition at line 228 of file qquickvaluetypes.cpp.
QString QQuickVector2DValueType::toString | ( | ) | const |
Definition at line 193 of file qquickvaluetypes.cpp.
QVector3D QQuickVector2DValueType::toVector3d | ( | ) | const |
Definition at line 253 of file qquickvaluetypes.cpp.
QVector4D QQuickVector2DValueType::toVector4d | ( | ) | const |
Definition at line 258 of file qquickvaluetypes.cpp.
qreal QQuickVector2DValueType::x | ( | ) | const |
Definition at line 198 of file qquickvaluetypes.cpp.
qreal QQuickVector2DValueType::y | ( | ) | const |
Definition at line 203 of file qquickvaluetypes.cpp.
|
readwrite |
Definition at line 92 of file qquickvaluetypes_p.h.
|
readwrite |
Definition at line 93 of file qquickvaluetypes_p.h.