diff options
author | Rhys Weatherley <rhys.weatherley@nokia.com> | 2009-07-09 11:11:35 +1000 |
---|---|---|
committer | Rhys Weatherley <rhys.weatherley@nokia.com> | 2009-07-09 11:11:35 +1000 |
commit | 3e50d680a37401c05d753982eb5d43c0f1225f63 (patch) | |
tree | cd52d303d28f719ddd316a203af702c42fae69bf /src | |
parent | 6cb86a552f4f320b47232ef745ae897ad5ead591 (diff) |
Directly copy QGenericMatrix members instead of using qMemCopy()
Using qMemCopy limits QGenericMatrix to plain old types like
float and double. Copying the values normally will allow
copy constructors to work on non plain types.
Reviewed-by: trustme
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/math3d/qgenericmatrix.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/gui/math3d/qgenericmatrix.h b/src/gui/math3d/qgenericmatrix.h index 1131f9b26b..7bdf70a68e 100644 --- a/src/gui/math3d/qgenericmatrix.h +++ b/src/gui/math3d/qgenericmatrix.h @@ -119,7 +119,9 @@ Q_INLINE_TEMPLATE QGenericMatrix<N, M, T, InnerT>::QGenericMatrix() template <int N, int M, typename T, typename InnerT> Q_INLINE_TEMPLATE QGenericMatrix<N, M, T, InnerT>::QGenericMatrix(const QGenericMatrix<N, M, T, InnerT>& other) { - qMemCopy(m, other.m, sizeof(m)); + for (int col = 0; col < N; ++col) + for (int row = 0; row < M; ++row) + m[col][row] = other.m[col][row]; } template <int N, int M, typename T, typename InnerT> |