summaryrefslogtreecommitdiffstats
path: root/tests/manual/mesh-morphing/main.cpp
diff options
context:
space:
mode:
authorJarek Kobus <jaroslaw.kobus@qt.io>2020-07-08 14:17:04 +0200
committerJarek Kobus <jaroslaw.kobus@qt.io>2020-07-09 12:22:15 +0200
commit93bd28e6d4ac8fdb6b07b30684e6b17ee515e44e (patch)
tree47c1299f1f7341e55c3c21d82425804aef2ac976 /tests/manual/mesh-morphing/main.cpp
parent1f7408d26d0274c9cbbfb2394778c721888af291 (diff)
Use QList instead of QVector in tests
Fix some const correctness. Use list-initialization. Task-number: QTBUG-84469 Change-Id: I48e643bd20e21bee031555af598ad95d9873de12 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Diffstat (limited to 'tests/manual/mesh-morphing/main.cpp')
-rw-r--r--tests/manual/mesh-morphing/main.cpp16
1 files changed, 6 insertions, 10 deletions
diff --git a/tests/manual/mesh-morphing/main.cpp b/tests/manual/mesh-morphing/main.cpp
index 5534943da..79f6eee60 100644
--- a/tests/manual/mesh-morphing/main.cpp
+++ b/tests/manual/mesh-morphing/main.cpp
@@ -111,18 +111,14 @@ int main(int argc, char **argv)
attributes.push_back(Qt3DCore::QAttribute::defaultPositionAttributeName());
attributes.push_back(Qt3DCore::QAttribute::defaultNormalAttributeName());
- QVector<Qt3DAnimation::QMorphTarget*> morphTargets;
- morphTargets.push_back(Qt3DAnimation::QMorphTarget::fromGeometry(cylinder1, attributes));
- morphTargets.push_back(Qt3DAnimation::QMorphTarget::fromGeometry(cylinder2, attributes));
- morphTargets.push_back(Qt3DAnimation::QMorphTarget::fromGeometry(cylinder3, attributes));
- morphTargets.push_back(morphTargets.first());
+ const QList<Qt3DAnimation::QMorphTarget*> morphTargets
+ = { Qt3DAnimation::QMorphTarget::fromGeometry(cylinder1, attributes),
+ Qt3DAnimation::QMorphTarget::fromGeometry(cylinder2, attributes),
+ Qt3DAnimation::QMorphTarget::fromGeometry(cylinder3, attributes),
+ Qt3DAnimation::QMorphTarget::fromGeometry(cylinder1, attributes) };
Qt3DAnimation::QVertexBlendAnimation *animation = new Qt3DAnimation::QVertexBlendAnimation;
- QVector<float> times;
- times.push_back(0.0f);
- times.push_back(5.0f);
- times.push_back(8.0f);
- times.push_back(12.0f);
+ const QList<float> times = { 0.0f, 5.0f, 8.0f, 12.0f };
auto renderer = new Qt3DRender::QGeometryRenderer;
renderer->setView(mesh);