diff options
-rw-r--r-- | examples/qt3d/examples-common/qt3dwindow.cpp | 8 | ||||
-rw-r--r-- | examples/qt3d/examples-common/qt3dwindow.h | 2 |
2 files changed, 10 insertions, 0 deletions
diff --git a/examples/qt3d/examples-common/qt3dwindow.cpp b/examples/qt3d/examples-common/qt3dwindow.cpp index b823c8e0c..8fbfd7100 100644 --- a/examples/qt3d/examples-common/qt3dwindow.cpp +++ b/examples/qt3d/examples-common/qt3dwindow.cpp @@ -54,6 +54,7 @@ #include <Qt3DRender/qframegraph.h> #include <Qt3DRender/qrenderaspect.h> #include <Qt3DInput/qinputaspect.h> +#include <Qt3DInput/qinputsettings.h> #include <Qt3DLogic/qlogicaspect.h> #include <Qt3DCore/qaspectengine.h> @@ -73,6 +74,7 @@ Qt3DWindow::Qt3DWindow(QScreen *screen) , m_frameGraph(new Qt3DRender::QFrameGraph) , m_forwardRenderer(new Qt3DRender::QForwardRenderer) , m_defaultCamera(new Qt3DRender::QCamera) + , m_inputSettings(new Qt3DInput::QInputSettings) , m_root(new Qt3DCore::QEntity) , m_userRoot(nullptr) , m_initialized(false) @@ -99,6 +101,8 @@ Qt3DWindow::Qt3DWindow(QScreen *screen) m_forwardRenderer->setCamera(m_defaultCamera); m_forwardRenderer->setSurface(this); m_frameGraph->setActiveFrameGraph(m_forwardRenderer); + + m_inputSettings->setEventSource(this); } Qt3DWindow::Qt3DWindow(QWindow *parent) @@ -109,6 +113,7 @@ Qt3DWindow::Qt3DWindow(QWindow *parent) , m_logicAspect(new Qt3DLogic::QLogicAspect) , m_frameGraph(new Qt3DRender::QFrameGraph) , m_defaultCamera(new Qt3DRender::QCamera) + , m_inputSettings(new Qt3DInput::QInputSettings) , m_root(new Qt3DCore::QEntity) , m_userRoot(nullptr) , m_initialized(false) @@ -135,6 +140,8 @@ Qt3DWindow::Qt3DWindow(QWindow *parent) m_forwardRenderer->setCamera(m_defaultCamera); m_forwardRenderer->setSurface(this); m_frameGraph->setActiveFrameGraph(m_forwardRenderer); + + m_inputSettings->setEventSource(this); } Qt3DWindow::~Qt3DWindow() @@ -186,6 +193,7 @@ void Qt3DWindow::showEvent(QShowEvent *e) m_userRoot->setParent(m_root); m_root->addComponent(m_frameGraph); + m_root->addComponent(m_inputSettings); m_aspectEngine->setRootEntity(m_root); m_initialized = true; diff --git a/examples/qt3d/examples-common/qt3dwindow.h b/examples/qt3d/examples-common/qt3dwindow.h index 11433e29a..fad0ace11 100644 --- a/examples/qt3d/examples-common/qt3dwindow.h +++ b/examples/qt3d/examples-common/qt3dwindow.h @@ -71,6 +71,7 @@ class QRenderAspect; namespace Qt3DInput { class QInputAspect; +class QInputSettings; } namespace Qt3DLogic { @@ -118,6 +119,7 @@ private: Qt3DRender::QCamera *m_defaultCamera; // Input configuration + Qt3DInput::QInputSettings *m_inputSettings; // Logic configuration |