5#define QT_QML_BUILD_REMOVED_API
11#if QT_QML_REMOVED_SINCE(6
, 5
)
13#include <QtQml/qjsengine.h>
15QJSValue QJSEngine::create(
int typeId,
const void *ptr)
17 QMetaType type(typeId);
18 return create(type, ptr);
21bool QJSEngine::convertV2(
const QJSValue &value,
int type,
void *ptr)
23 return convertV2(value, QMetaType(type), ptr);
28#if QT_QML_REMOVED_SINCE(6
, 6
)
29#include <QtQml/qqmlprivate.h>
30#include <QtQml/private/qv4executablecompilationunit_p.h>
31#include <QtQml/private/qv4lookup_p.h>
33bool QQmlPrivate::AOTCompiledContext::getEnumLookup(uint index,
int *target)
const
35 using namespace QQmlPrivate;
36 QV4::Lookup *lookup = compilationUnit->runtimeLookups + index;
37 auto mt = QMetaType(lookup->qmlEnumValueLookup.metaType);
39 getEnumLookup(index, buffer.data());
40 *target = buffer.toInt();
45#if QT_QML_REMOVED_SINCE(6
, 9
)
46#include <QtQml/qqmlprivate.h>
47#include <QtQml/private/qv4executablecompilationunit_p.h>
48#include <QtQml/private/qv4lookup_p.h>
49#include <QtQml/private/qv4qobjectwrapper_p.h>
51bool QQmlPrivate::AOTCompiledContext::callObjectPropertyLookup(
52 uint index, QObject *object,
void **args,
const QMetaType *types,
int argc)
const
54 QV4::Lookup *lookup = compilationUnit->runtimeLookups + index;
55 QV4::Scope scope(engine->handle());
56 QV4::ScopedValue thisObject(scope, QV4::QObjectWrapper::wrap(scope.engine, object));
57 QV4::ScopedFunctionObject function(scope, lookup->getter(engine->handle(), thisObject));
59 scope.engine->throwTypeError(
60 QStringLiteral(
"Property '%1' of object [object Object] is not a function")
61 .arg(compilationUnit->runtimeStrings[lookup->nameIndex]->toQString()));
65 function->call(object, args, types, argc);
66 return !scope.hasException();
69void QQmlPrivate::AOTCompiledContext::initCallObjectPropertyLookup(uint index)
const
72 Q_ASSERT(engine->hasError());
73 engine->handle()->amendException();
76bool QQmlPrivate::AOTCompiledContext::callQmlContextPropertyLookup(
77 uint index,
void **args,
const QMetaType *types,
int argc)
const
79 QV4::Lookup *lookup = compilationUnit->runtimeLookups + index;
80 QV4::Scope scope(engine->handle());
81 QV4::ScopedValue thisObject(scope);
82 QV4::ScopedFunctionObject function(
83 scope, lookup->contextGetter(scope.engine, thisObject));
85 scope.engine->throwTypeError(
86 QStringLiteral(
"Property '%1' of object [null] is not a function").arg(
87 compilationUnit->runtimeStrings[lookup->nameIndex]->toQString()));
91 function->call(qmlScopeObject, args, types, argc);
92 return !scope.hasException();
95void QQmlPrivate::AOTCompiledContext::initCallQmlContextPropertyLookup(uint index)
const
98 Q_ASSERT(engine->hasError());
99 engine->handle()->amendException();
102bool QQmlPrivate::AOTCompiledContext::loadGlobalLookup(uint index,
void *target, QMetaType type)
const
104 QV4::Lookup *lookup = compilationUnit->runtimeLookups + index;
105 QV4::Scope scope(engine->handle());
106 QV4::ScopedValue v(scope, lookup->globalGetter(engine->handle()));
107 if (!QV4::ExecutionEngine::metaTypeFromJS(
109 engine->handle()->throwTypeError();
115void QQmlPrivate::AOTCompiledContext::initLoadGlobalLookup(uint index)
const
118 Q_ASSERT(engine->hasError());
119 engine->handle()->amendException();
122QVariant QQmlPrivate::AOTCompiledContext::constructValueType(
123 QMetaType resultMetaType,
const QMetaObject *resultMetaObject,
124 int ctorIndex,
void *ctorArg)
const
126 void *args[] = {ctorArg};
127 return QQmlValueTypeProvider::constructValueType(
128 resultMetaType, resultMetaObject, ctorIndex, args);
131bool QQmlPrivate::AOTCompiledContext::callGlobalLookup(
132 uint index,
void **args,
const QMetaType *types,
int argc)
const
134 QV4::Lookup *lookup = compilationUnit->runtimeLookups + index;
135 QV4::Scope scope(engine->handle());
136 QV4::ScopedFunctionObject function(scope, lookup->globalGetter(scope.engine));
138 scope.engine->throwTypeError(
139 QStringLiteral(
"Property '%1' of object [null] is not a function")
140 .arg(compilationUnit->runtimeStrings[lookup->nameIndex]->toQString()));
144 function->call(
nullptr, args, types, argc);
148void QQmlPrivate::AOTCompiledContext::initCallGlobalLookup(uint index)
const
151 Q_ASSERT(engine->hasError());
152 engine->handle()->amendException();
155void QQmlPrivate::AOTCompiledContext::initLoadScopeObjectPropertyLookup(
156 uint index, QMetaType type)
const
159 return initLoadScopeObjectPropertyLookup(index);
162void QQmlPrivate::AOTCompiledContext::initGetObjectLookup(
163 uint index, QObject *object, QMetaType type)
const
165 return type == QMetaType::fromType<QVariant>()
166 ? initGetObjectLookupAsVariant(index, object)
167 : initGetObjectLookup(index, object);
170void QQmlPrivate::AOTCompiledContext::initSetObjectLookup(
171 uint index, QObject *object, QMetaType type)
const
173 return type == QMetaType::fromType<QVariant>()
174 ? initSetObjectLookupAsVariant(index, object)
175 : initSetObjectLookup(index, object);
178void QQmlPrivate::AOTCompiledContext::initGetValueLookup(
179 uint index,
const QMetaObject *metaObject, QMetaType type)
const {
181 initGetValueLookup(index, metaObject);
184void QQmlPrivate::AOTCompiledContext::initSetValueLookup(
185 uint index,
const QMetaObject *metaObject, QMetaType type)
const
188 initSetValueLookup(index, metaObject);