aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqml.cpp
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2021-01-07 16:07:00 +0100
committerUlf Hermann <ulf.hermann@qt.io>2021-01-11 22:59:34 +0100
commit9694e0631da9ae94dab4229091f382528700af90 (patch)
treebd2462d87e497829310df0bf6e2b18e5ea5161cb /src/qml/qml/qqml.cpp
parent05b5a0896da2c12d50898abb2bf3dc5c5f158a16 (diff)
Pass a more comprehensive context to AOT-compiled functions
We need the compilation unit, and a way to retrieve JavaScript metatypes from it. Also, prepare for cases where we only have a QJSEngine, not a QQmlEngine, and pass the scope object as part of the AOT context. Change-Id: Ica81e92c99f3c9b6baffd04db1e0e91603fd2ac7 Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/qml/qml/qqml.cpp')
-rw-r--r--src/qml/qml/qqml.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/qml/qml/qqml.cpp b/src/qml/qml/qqml.cpp
index 40e629284b..9e71c968b8 100644
--- a/src/qml/qml/qqml.cpp
+++ b/src/qml/qml/qqml.cpp
@@ -41,6 +41,7 @@
#include <QtQml/qqmlprivate.h>
+#include <private/qjsvalue_p.h>
#include <private/qqmlengine_p.h>
#include <private/qqmlmetatype_p.h>
#include <private/qqmlmetatypedata_p.h>
@@ -561,4 +562,10 @@ namespace QQmlPrivate {
}
}
+QJSValue QQmlPrivate::AOTCompiledContext::jsMetaType(int index) const
+{
+ return QJSValuePrivate::fromReturnedValue(
+ compilationUnit->runtimeClasses[index]->asReturnedValue());
+}
+
QT_END_NAMESPACE