diff options
Diffstat (limited to 'src/gui/math3d/qvector3d.cpp')
-rw-r--r-- | src/gui/math3d/qvector3d.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/gui/math3d/qvector3d.cpp b/src/gui/math3d/qvector3d.cpp index 0e3f4e1..5c96979 100644 --- a/src/gui/math3d/qvector3d.cpp +++ b/src/gui/math3d/qvector3d.cpp @@ -43,6 +43,7 @@ #include "qvector2d.h" #include "qvector4d.h" #include <QtCore/qmath.h> +#include <QtCore/qvariant.h> #include <QtCore/qdebug.h> QT_BEGIN_NAMESPACE @@ -530,6 +531,14 @@ QVector4D QVector3D::toVector4D() const */ /*! + Returns the 3D vector as a QVariant. +*/ +QVector3D::operator QVariant() const +{ + return QVariant(QVariant::Vector3D, this); +} + +/*! Returns the length of the vector from the origin. \sa lengthSquared(), normalized() |