summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJari Karppinen <jari.karppinen@qt.io>2019-06-11 10:09:55 +0300
committerJari Karppinen <jari.karppinen@qt.io>2019-06-11 11:05:03 +0300
commite366719a6ca814d3a1706e7ad731ff6655f4f59d (patch)
treee9e94fa27a85cd5366df102fb899c7cd5b23b910 /src
parentb04500be2085335d8377576a34db5d78ceb52d65 (diff)
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 <miikka.heikkinen@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/api/studio3dqml/q3dsstudio3d.cpp4
1 files changed, 3 insertions, 1 deletions
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 <QtCore/qdebug.h>
#include <QtCore/qfileinfo.h>
#include <QtQuick/qquickwindow.h>
+#include <QtQml/qqmlcontext.h>
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();
}