diff options
author | Paul Lemire <paul.lemire@kdab.com> | 2014-08-29 09:49:58 +0200 |
---|---|---|
committer | Sean Harmer <sean.harmer@kdab.com> | 2014-09-15 12:36:26 +0200 |
commit | 4988d4129d8d6da4503437e03bf1fc0208625008 (patch) | |
tree | ce1db3002d624a1dc371e67c0512b241896f0ded /examples/cpp_example | |
parent | 7105793cddd714aeef921e12c8bfac67554ba4e5 (diff) |
Transform QAbstractScene to QComponent
Will need several other changes (in later commits) to be visible again.
Change-Id: I328ae3ac5a24bd3ce1909d1ae281a31dae438925
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Diffstat (limited to 'examples/cpp_example')
-rw-r--r-- | examples/cpp_example/main.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/examples/cpp_example/main.cpp b/examples/cpp_example/main.cpp index e6ed1c277..c18485c60 100644 --- a/examples/cpp_example/main.cpp +++ b/examples/cpp_example/main.cpp @@ -105,6 +105,7 @@ int main(int ac, char **av) torusEntity->addComponent(torusTransforms); // Scene file + Qt3D::QEntity *sceneEntity = new Qt3D::QEntity(); Qt3D::QScene *scene = new Qt3D::QScene(); scene->setObjectName(QStringLiteral("scene")); Qt3D::QTransform *sceneTransform = new Qt3D::QTransform(); @@ -113,9 +114,10 @@ int main(int ac, char **av) sceneTranslateTransform->setDy(0.5); sceneTranslateTransform->setDz(-10); sceneTransform->appendTransform(sceneTranslateTransform); - scene->addComponent(sceneTransform); + sceneEntity->addComponent(sceneTransform); // scene->setSource(":/assets/gltf/wine/wine.json"); scene->setSource(":/assets/test_scene.dae"); + sceneEntity->addComponent(scene); // Camera Qt3D::QCamera *cameraEntity = new Qt3D::QCamera(); @@ -155,7 +157,7 @@ int main(int ac, char **av) // Build Node Tree rootEntity->addChild(cameraEntity); rootEntity->addChild(torusEntity); - rootEntity->addChild(scene); + rootEntity->addChild(sceneEntity); // Set root object of the scene view.setRootObject(rootEntity); |