diff options
author | Laszlo Agocs <laszlo.agocs@qt.io> | 2018-07-30 12:03:18 +0200 |
---|---|---|
committer | Laszlo Agocs <laszlo.agocs@qt.io> | 2018-07-30 11:10:27 +0000 |
commit | db62fe6d31c5fb02804d7e6d4cf4adbc6ac3d0b6 (patch) | |
tree | 8941a83d54a483207fa7888505e87d0445d38132 /tests | |
parent | ce974eb0112fe23b127e937470a5d2689dccb528 (diff) |
Make Q3DSEngine::setPresentation a first class API
Previously this was plagued by todos since it did not support
any types of subpresentations properly. However, that would not be
useful anyway: a programatically constructed and managed scene will have
no use of the "static" subpresentation concept, especially if QML is
used which provides the standard component and object model.
So drop the QVector and make the function take a single presentation
only.
Change-Id: I4bc6787dd057bfd08a3f542fa8bbac6efde774e0
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/manual/qt3dsexplorer/manualpresentationtest.cpp | 4 | ||||
-rw-r--r-- | tests/manual/qt3dsexplorer/manualpresentationtest.h | 2 | ||||
-rw-r--r-- | tests/manual/qt3dsexplorer/q3dsexplorermainwindow.cpp | 4 |
3 files changed, 5 insertions, 5 deletions
diff --git a/tests/manual/qt3dsexplorer/manualpresentationtest.cpp b/tests/manual/qt3dsexplorer/manualpresentationtest.cpp index 6aa09ce..c1b9985 100644 --- a/tests/manual/qt3dsexplorer/manualpresentationtest.cpp +++ b/tests/manual/qt3dsexplorer/manualpresentationtest.cpp @@ -31,7 +31,7 @@ QT_BEGIN_NAMESPACE -QVector<Q3DSUipPresentation *> ManualPresentationTest::build() +Q3DSUipPresentation *ManualPresentationTest::build() { QScopedPointer<Q3DSUipPresentation> mainPres(new Q3DSUipPresentation); mainPres->setPresentationWidth(800); @@ -102,7 +102,7 @@ QVector<Q3DSUipPresentation *> ManualPresentationTest::build() // done, this is a full presentation with a layer, camera, a light and a cube - return { mainPres.take() }; + return mainPres.take(); } QT_END_NAMESPACE diff --git a/tests/manual/qt3dsexplorer/manualpresentationtest.h b/tests/manual/qt3dsexplorer/manualpresentationtest.h index a9bb549..8e31ed2 100644 --- a/tests/manual/qt3dsexplorer/manualpresentationtest.h +++ b/tests/manual/qt3dsexplorer/manualpresentationtest.h @@ -37,7 +37,7 @@ QT_BEGIN_NAMESPACE class ManualPresentationTest { public: - QVector<Q3DSUipPresentation *> build(); + Q3DSUipPresentation *build(); }; QT_END_NAMESPACE diff --git a/tests/manual/qt3dsexplorer/q3dsexplorermainwindow.cpp b/tests/manual/qt3dsexplorer/q3dsexplorermainwindow.cpp index 9b3a271..a14e035 100644 --- a/tests/manual/qt3dsexplorer/q3dsexplorermainwindow.cpp +++ b/tests/manual/qt3dsexplorer/q3dsexplorermainwindow.cpp @@ -198,10 +198,10 @@ Q3DSExplorerMainWindow::Q3DSExplorerMainWindow(Q3DSWindow *view, Q3DSRemoteDeplo if (!m_manualPresentationTest) m_manualPresentationTest = new ManualPresentationTest; auto p = m_manualPresentationTest->build(); - if (view->engine()->setPresentations(p)) + if (view->engine()->setPresentation(p)) updatePresentation(); else - qDeleteAll(p); + delete p; }); QMenu *profileSubMenu = new QMenu(tr("&Profile and Debug")); QAction *showDebugView = profileSubMenu->addAction(tr("Toggle in-scene &debug view"), this, [view] { |