diff options
author | Laszlo Agocs <laszlo.agocs@theqtcompany.com> | 2015-02-17 13:39:13 +0100 |
---|---|---|
committer | Laszlo Agocs <laszlo.agocs@theqtcompany.com> | 2015-02-17 15:22:14 +0000 |
commit | 3f9d0a60b678011691c7b19f705fcaeaab1c975e (patch) | |
tree | 0fcafaa6f21e845f3b6fc03ffe3b4be1a145f524 /src | |
parent | ae45b629b8a40318fa3e619116b0dd84c987f6ed (diff) |
Hardwire input aspect into Scene3D when requested
If we do not rely on 3dinput in any form then no factory will ever get registered for "input",
simply because the entire input module is not loaded.
Change-Id: Ic122f7c046d5fd7c07fd3229254a3e7ae36fd3de
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
Reviewed-by: Kevin Ottens <kevin.ottens@kdab.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/quick3d/imports/scene3d/importsscene3d.pro | 2 | ||||
-rw-r--r-- | src/quick3d/imports/scene3d/scene3ditem.cpp | 5 |
2 files changed, 6 insertions, 1 deletions
diff --git a/src/quick3d/imports/scene3d/importsscene3d.pro b/src/quick3d/imports/scene3d/importsscene3d.pro index cd8402320..074f60810 100644 --- a/src/quick3d/imports/scene3d/importsscene3d.pro +++ b/src/quick3d/imports/scene3d/importsscene3d.pro @@ -2,7 +2,7 @@ CXX_MODULE = qml TARGET = qtquickscene3dplugin TARGETPATH = QtQuick/Scene3D -QT += qml quick 3dcore 3drenderer +QT += qml quick 3dcore 3drenderer 3dinput HEADERS += \ qtquickscene3dplugin.h \ diff --git a/src/quick3d/imports/scene3d/scene3ditem.cpp b/src/quick3d/imports/scene3d/scene3ditem.cpp index 26617b036..04791ec03 100644 --- a/src/quick3d/imports/scene3d/scene3ditem.cpp +++ b/src/quick3d/imports/scene3d/scene3ditem.cpp @@ -38,6 +38,7 @@ #include <Qt3DCore/QAspectEngine> #include <Qt3DRenderer/QRenderAspect> +#include <Qt3DInput/QInputAspect> #include <QOpenGLContext> #include <QOpenGLFramebufferObject> @@ -164,6 +165,10 @@ void Scene3DItem::setAspects(const QStringList &aspects) Q_FOREACH (const QString &aspect, m_aspects) { if (aspect == QStringLiteral("render")) // This one is hardwired anyway continue; + if (aspect == QStringLiteral("input")) { + m_aspectEngine->registerAspect(new Qt3D::QInputAspect); + continue; + } m_aspectEngine->registerAspect(aspect); } |