QVector2D介绍(翻译)

The QVector2D class represents a vector or vertex(顶点,例如三角形的一个顶点) in 2D space.

The QVector2D class can also be used to represent vertices in 2D space. We therefore do not need to provide a separate vertex class.

Note: By design values in the QVector2D instance are stored as float. This means that on platforms where the qreal arguments to QVector2D functions are represented by double values, it is possible to lose precision(精度不够).

 


QVector2D ()
QVector2D ( qreal xpos, qreal ypos )
QVector2D ( const QPoint & point )
QVector2D ( const QPointF & point )
QVector2D ( const QVector3D & vector )
QVector2D ( const QVector4D & vector )
bool    isNull () const
qreal    length () const
qreal    lengthSquared () const
void    normalize ()
QVector2D    normalized () const
void    setX ( qreal x )
void    setY ( qreal y )
QPoint    toPoint () const
QPointF    toPointF () const
QVector3D    toVector3D () const
QVector4D    toVector4D () const
qreal    x () const
qreal    y () const
operator QVariant () const
QVector2D &    operator*= ( qreal factor )
QVector2D &    operator*= ( const QVector2D & vector )
QVector2D &    operator+= ( const QVector2D & vector )
QVector2D &    operator-= ( const QVector2D & vector )
QVector2D &    operator/= ( qreal divisor )

 

 

你可能感兴趣的:(QT)