diff options
author | Tomi Korpipää <tomi.korpipaa@qt.io> | 2019-05-21 12:38:46 +0300 |
---|---|---|
committer | Tomi Korpipää <tomi.korpipaa@qt.io> | 2019-05-21 12:38:46 +0300 |
commit | 6e6fc518adf0d4da2d5bbe0deaa558c192c85a15 (patch) | |
tree | 39781293e726a8c698a6494330e14291f525c6f1 /src/QtExtras/qmlstreamer/q3dsqmlstreamproxy.cpp | |
parent | da98cee59c3ff8d26f1c10d203733cab24e7a57c (diff) |
QML Engine patch
Change-Id: I0c34762c5de069165035bf9dacbe0d1a7ec33035
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
Diffstat (limited to 'src/QtExtras/qmlstreamer/q3dsqmlstreamproxy.cpp')
-rw-r--r-- | src/QtExtras/qmlstreamer/q3dsqmlstreamproxy.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/QtExtras/qmlstreamer/q3dsqmlstreamproxy.cpp b/src/QtExtras/qmlstreamer/q3dsqmlstreamproxy.cpp index caa633ac..9b8550cf 100644 --- a/src/QtExtras/qmlstreamer/q3dsqmlstreamproxy.cpp +++ b/src/QtExtras/qmlstreamer/q3dsqmlstreamproxy.cpp @@ -237,3 +237,17 @@ void Q3DSQmlStreamProxy::setPath(const QString& path) QString modPath = QFileInfo(path).path(); // path() strips filename out m_path = pathToUrl(modPath); } + +void Q3DSQmlStreamProxy::setEngine(QQmlEngine *engine) +{ + if (m_engine) + delete m_engine; + + m_engine = engine; + + // Add extra import path for binary installations + QString extraImportPath(QStringLiteral("%1/qml")); + m_engine->addImportPath(extraImportPath.arg(QGuiApplication::applicationDirPath())); + + m_engine->setIncubationController(new Q3DSIncubationController(this)); +} |