Detailed Description
The QVector2DArray class is a convenience for wrapping a QArray of QVector2D values.
QVector2DArray is used to build an array of 2D vector values based on floating-point x and y arguments:
QVector2DArray array;
array.append(1.0f, 2.0f);
array.append(-1.0f, 2.0f);
array.append(1.0f, -2.0f);
This is more convenient and readable than the equivalent with QArray:
QArray<QVector2D> array;
array.append(QVector2D(1.0f, 2.0f));
array.append(QVector2D(-1.0f, 2.0f));
array.append(QVector2D(1.0f, -2.0f));
QVector2DArray also has convenience functions for transforming the contents of the array with translate(), translated(), transform(), and transformed().
Member Function Documentation
QVector2DArray::QVector2DArray()
Constructs an empty array of QVector2D values.
QVector2DArray::QVector2DArray(int size, const QVector2D & value = QVector2D())
Constructs an array of QVector2D values with an initial size. All elements in the array are initialized to value.
QVector2DArray::QVector2DArray(const QArray<QVector2D> & other)
Constructs a copy of other.
void QVector2DArray::append(qreal x, qreal y)
This is an overloaded function.
Appends (x, y) to this array of QVector2D values.
void QVector2DArray::append(const QPointF & point)
This is an overloaded function.
Appends point to this array of QVector2D values.
void QVector2DArray::append(const QPoint & point)
This is an overloaded function.
Appends point to this array of QVector2D values.
void QVector2DArray::scale(qreal scale)
Multiplies the elements in this array of QVector2D values by the scale.
See also scaled().
QVector2DArray QVector2DArray::scaled(qreal scale) const
Returns a copy of this array of QVector2D values, multiplied by the scale.
See also scale().
void QVector2DArray::transform(const QMatrix4x4 & matrix)
Transforms the elements in this array of QVector2D values by matrix.
See also transformed().
QArray<QVector2D> QVector2DArray::transformed(const QMatrix4x4 & matrix) const
Returns a copy of this array of QVector2D values, transformed by matrix.
See also transform().
void QVector2DArray::translate(const QVector2D & value)
Translates the elements in this array of QVector2D values by the components of value.
See also translated().
void QVector2DArray::translate(qreal x, qreal y)
This is an overloaded function.
Translates the elements in this array of QVector2D values by (x, y).
See also translated().
QArray<QVector2D> QVector2DArray::translated(const QVector2D & value) const
Returns a copy of this array of QVector2D values, translated by the components of value.
See also translate().
This is an overloaded function.
Returns a copy of this array of QVector2D values, translated by (x, y).
See also translate().