aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@theqtcompany.com>2016-02-01 09:33:38 +0100
committerJani Heikkinen <jani.heikkinen@theqtcompany.com>2016-02-02 13:08:51 +0000
commitd444d21a517c45c0fda0bdf955cbda61e0088be6 (patch)
tree5db991b718ccbeea40e18eeb51528024daf6a7c7 /src
parent1d417a7bfa99695db7d8bf6b28a5141bf97e96cc (diff)
Fix crash in Installer Framework when used with Qt 5.6
IFW uses QQmlV4Function in a QJSEngine environment, so there is no QML context. Up to commit cc98678f404cd49750076795f39b31bfa36c80c3 that would work. Let's fall back to the root context as scope if we don't have a qml context. Change-Id: Ib240746a95a0d16d61620f97abc31e4c74f36723 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
Diffstat (limited to 'src')
-rw-r--r--src/qml/jsruntime/qv4qobjectwrapper.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/qml/jsruntime/qv4qobjectwrapper.cpp b/src/qml/jsruntime/qv4qobjectwrapper.cpp
index 8f471132b7..bcd97efee8 100644
--- a/src/qml/jsruntime/qv4qobjectwrapper.cpp
+++ b/src/qml/jsruntime/qv4qobjectwrapper.cpp
@@ -330,6 +330,8 @@ ReturnedValue QObjectWrapper::getProperty(ExecutionEngine *engine, QObject *obje
} else if (property->isV4Function()) {
Scope scope(engine);
ScopedContext global(scope, engine->qmlContext());
+ if (!global)
+ global = engine->rootContext();
return QV4::QObjectMethod::create(global, object, property->coreIndex);
} else if (property->isSignalHandler()) {
QmlSignalHandler::initProto(engine);