From e366719a6ca814d3a1706e7ad731ff6655f4f59d Mon Sep 17 00:00:00 2001 From: Jari Karppinen Date: Tue, 11 Jun 2019 10:09:55 +0300 Subject: Pass QML engine to stream proxy QML stream proxy creates a new QML engine if it has not been set one. This loses QML import paths that have been added on startup, and breaks QML imports in QML streams. Task-number: QT3DS-3597 Change-Id: I13def4b6f0f9078d9d63eb0010f0a50ce4dac7ce Reviewed-by: Miikka Heikkinen --- src/api/studio3dqml/q3dsstudio3d.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/api/studio3dqml/q3dsstudio3d.cpp') diff --git a/src/api/studio3dqml/q3dsstudio3d.cpp b/src/api/studio3dqml/q3dsstudio3d.cpp index 5a46089..2cf8ed2 100644 --- a/src/api/studio3dqml/q3dsstudio3d.cpp +++ b/src/api/studio3dqml/q3dsstudio3d.cpp @@ -40,6 +40,7 @@ #include #include #include +#include QT_BEGIN_NAMESPACE @@ -271,7 +272,8 @@ void Q3DSStudio3D::componentComplete() m_presentation->d_ptr->setCommandQueue(&m_pendingCommands); // Ensure qml stream proxy gets created on main thread - m_presentation->d_ptr->streamProxy(); + QQmlContext *ctx = QQmlEngine::contextForObject(this); + m_presentation->d_ptr->streamProxy()->setEngine(ctx->engine()); QQuickFramebufferObject::componentComplete(); } -- cgit v1.2.3