diff options
Diffstat (limited to 'tests/manual/custom-mesh-update-data-cpp/main.cpp')
-rw-r--r-- | tests/manual/custom-mesh-update-data-cpp/main.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/manual/custom-mesh-update-data-cpp/main.cpp b/tests/manual/custom-mesh-update-data-cpp/main.cpp index 80ee2088d..3d9507049 100644 --- a/tests/manual/custom-mesh-update-data-cpp/main.cpp +++ b/tests/manual/custom-mesh-update-data-cpp/main.cpp @@ -167,7 +167,7 @@ int main(int argc, char* argv[]) QVector3D blue(0.0f, 0.0f, 1.0f); QVector3D white(1.0f, 1.0f, 1.0f); - QVector<QVector3D> vertices = QVector<QVector3D>() + const QVector<QVector3D> vertices = QVector<QVector3D>() << v0 << n0 << red << v1 << n1 << blue << v2 << n2 << green @@ -176,7 +176,7 @@ int main(int argc, char* argv[]) float *rawVertexArray = reinterpret_cast<float *>(vertexBufferData.data()); int idx = 0; - Q_FOREACH (const QVector3D &v, vertices) { + for (const QVector3D &v : vertices) { rawVertexArray[idx++] = v.x(); rawVertexArray[idx++] = v.y(); rawVertexArray[idx++] = v.z(); @@ -287,12 +287,12 @@ void TimerObject::timeout() QVector3D c2(qFabs(qSin(angle)), qFabs(qCos(angle + M_PI_4)), qFabs(qSin(angle + M_PI_4))); QVector3D c3(qFabs(qSin(angle + M_PI_4)), qFabs(qSin(angle)), qFabs(qCos(angle))); - QVector<QVector3D> colors = QVector<QVector3D>() << c1 << c2 << c3; + const QVector<QVector3D> colors = QVector<QVector3D>() << c1 << c2 << c3; float *rawVertexArray = reinterpret_cast<float *>(updateData.data()); int pos = 6 * sizeof(float); //color offset - Q_FOREACH (const QVector3D &v, colors) { + for (const QVector3D &v : colors) { rawVertexArray[0] = v.x(); rawVertexArray[1] = v.y(); rawVertexArray[2] = v.z(); |