diff options
author | Laszlo Agocs <laszlo.agocs@qt.io> | 2018-03-19 15:54:05 +0100 |
---|---|---|
committer | Laszlo Agocs <laszlo.agocs@qt.io> | 2018-03-20 15:30:59 +0000 |
commit | 3a81d7b62225f558ff48e3302d91725e00f2c3f9 (patch) | |
tree | 0626e49ce42d24bb2f8f85f5687bd5dd283fdee2 /src/imports/studio3d/q3dsstudio3ditem.cpp | |
parent | 302ae0ccd719713a872a292ba20f5f1f15cdc263 (diff) |
Q3DSPresentation public API: fireEvent and a few enablers
Some of the to-be-added APIs involve the silly element path concept which
we cannot avoid now. So move the lookup function to Q3DSEngine and add the
opposite that constructs a Scene.Layer.BlahBlah type of path from an object.
The duplication of overrides for Q3DSPresentationController functions is
now avoided by implemented some of the handleXxxxx functions in the base
class (the ones that just forward to Q3DSEngine).
Change-Id: I67cca6c0f56e545c1ba4dbf040dff26273bf823f
Reviewed-by: Christian Stromme <christian.stromme@qt.io>
Diffstat (limited to 'src/imports/studio3d/q3dsstudio3ditem.cpp')
-rw-r--r-- | src/imports/studio3d/q3dsstudio3ditem.cpp | 51 |
1 files changed, 1 insertions, 50 deletions
diff --git a/src/imports/studio3d/q3dsstudio3ditem.cpp b/src/imports/studio3d/q3dsstudio3ditem.cpp index 204afd1..e66aeb4 100644 --- a/src/imports/studio3d/q3dsstudio3ditem.cpp +++ b/src/imports/studio3d/q3dsstudio3ditem.cpp @@ -151,56 +151,6 @@ void Q3DSStudio3DItem::handlePresentationReload() createEngine(); } -void Q3DSStudio3DItem::handleDataInputValue(const QString &name, const QVariant &value) -{ - if (m_engine) - m_engine->setDataInputValue(name, value); -} - -void Q3DSStudio3DItem::handlePresentationKeyPressEvent(QKeyEvent *e) -{ - if (m_engine) - m_engine->handleKeyPressEvent(e); -} - -void Q3DSStudio3DItem::handlePresentationKeyReleaseEvent(QKeyEvent *e) -{ - if (m_engine) - m_engine->handleKeyReleaseEvent(e); -} - -void Q3DSStudio3DItem::handlePresentationMousePressEvent(QMouseEvent *e) -{ - if (m_engine) - m_engine->handleMousePressEvent(e); -} - -void Q3DSStudio3DItem::handlePresentationMouseMoveEvent(QMouseEvent *e) -{ - if (m_engine) - m_engine->handleMouseMoveEvent(e); -} - -void Q3DSStudio3DItem::handlePresentationMouseReleaseEvent(QMouseEvent *e) -{ - if (m_engine) - m_engine->handleMouseReleaseEvent(e); -} - -void Q3DSStudio3DItem::handlePresentationMouseDoubleClickEvent(QMouseEvent *e) -{ - if (m_engine) - m_engine->handleMouseDoubleClickEvent(e); -} - -#if QT_CONFIG(wheelevent) -void Q3DSStudio3DItem::handlePresentationWheelEvent(QWheelEvent *e) -{ - if (m_engine) - m_engine->handleWheelEvent(e); -} -#endif - void Q3DSStudio3DItem::createEngine() { // note: cannot have an engine without the source set @@ -223,6 +173,7 @@ void Q3DSStudio3DItem::createEngine() // We create the render aspect ourselves on the Quick render thread. m_engine->setFlags(Q3DSEngine::WithoutRenderAspect); + setPresentationControllerEngine(m_engine); QObject::connect(m_engine, &Q3DSEngine::customSignalEmitted, m_presentation, &Q3DSPresentation::customSignalEmitted); if (QWindow *rw = QQuickRenderControl::renderWindowFor(w)) { |