4#define QT_QML_BUILD_REMOVED_API
10#if QT_QML_REMOVED_SINCE(6
, 5
)
12#include <QtQml/qjsengine.h>
14QJSValue QJSEngine::create(
int typeId,
const void *ptr)
16 QMetaType type(typeId);
17 return create(type, ptr);
20bool QJSEngine::convertV2(
const QJSValue &value,
int type,
void *ptr)
22 return convertV2(value, QMetaType(type), ptr);
27#if QT_QML_REMOVED_SINCE(6
, 6
)
28#include <QtQml/qqmlprivate.h>
29#include <QtQml/private/qv4executablecompilationunit_p.h>
30#include <QtQml/private/qv4lookup_p.h>
32bool QQmlPrivate::AOTCompiledContext::getEnumLookup(uint index,
int *target)
const
34 using namespace QQmlPrivate;
35 QV4::Lookup *lookup = compilationUnit->runtimeLookups + index;
36 auto mt = QMetaType(lookup->qmlEnumValueLookup.metaType);
38 getEnumLookup(index, buffer.data());
39 *target = buffer.toInt();
44#if QT_QML_REMOVED_SINCE(6
, 9
)
45#include <QtQml/qqmlprivate.h>
46#include <QtQml/private/qv4executablecompilationunit_p.h>
47#include <QtQml/private/qv4lookup_p.h>
48#include <QtQml/private/qv4qobjectwrapper_p.h>
50bool QQmlPrivate::AOTCompiledContext::callObjectPropertyLookup(
51 uint index, QObject *object,
void **args,
const QMetaType *types,
int argc)
const
53 QV4::Lookup *lookup = compilationUnit->runtimeLookups + index;
54 QV4::Scope scope(engine->handle());
55 QV4::ScopedValue thisObject(scope, QV4::QObjectWrapper::wrap(scope.engine, object));
56 QV4::ScopedFunctionObject function(scope, lookup->getter(engine->handle(), thisObject));
58 scope.engine->throwTypeError(
59 QStringLiteral(
"Property '%1' of object [object Object] is not a function")
60 .arg(compilationUnit->runtimeStrings[lookup->nameIndex]->toQString()));
64 function->call(object, args, types, argc);
65 return !scope.hasException();
68void QQmlPrivate::AOTCompiledContext::initCallObjectPropertyLookup(uint index)
const
71 Q_ASSERT(engine->hasError());
72 engine->handle()->amendException();
75bool QQmlPrivate::AOTCompiledContext::callQmlContextPropertyLookup(
76 uint index,
void **args,
const QMetaType *types,
int argc)
const
78 QV4::Lookup *lookup = compilationUnit->runtimeLookups + index;
79 QV4::Scope scope(engine->handle());
80 QV4::ScopedValue thisObject(scope);
81 QV4::ScopedFunctionObject function(
82 scope, lookup->contextGetter(scope.engine, thisObject));
84 scope.engine->throwTypeError(
85 QStringLiteral(
"Property '%1' of object [null] is not a function").arg(
86 compilationUnit->runtimeStrings[lookup->nameIndex]->toQString()));
90 function->call(qmlScopeObject, args, types, argc);
91 return !scope.hasException();
94void QQmlPrivate::AOTCompiledContext::initCallQmlContextPropertyLookup(uint index)
const
97 Q_ASSERT(engine->hasError());
98 engine->handle()->amendException();
101bool QQmlPrivate::AOTCompiledContext::loadGlobalLookup(uint index,
void *target, QMetaType type)
const
103 QV4::Lookup *lookup = compilationUnit->runtimeLookups + index;
104 QV4::Scope scope(engine->handle());
105 QV4::ScopedValue v(scope, lookup->globalGetter(engine->handle()));
106 if (!QV4::ExecutionEngine::metaTypeFromJS(
108 engine->handle()->throwTypeError();
114void QQmlPrivate::AOTCompiledContext::initLoadGlobalLookup(uint index)
const
117 Q_ASSERT(engine->hasError());
118 engine->handle()->amendException();
121QVariant QQmlPrivate::AOTCompiledContext::constructValueType(
122 QMetaType resultMetaType,
const QMetaObject *resultMetaObject,
123 int ctorIndex,
void *ctorArg)
const
125 void *args[] = {ctorArg};
126 return QQmlValueTypeProvider::constructValueType(
127 resultMetaType, resultMetaObject, ctorIndex, args);
130bool QQmlPrivate::AOTCompiledContext::callGlobalLookup(
131 uint index,
void **args,
const QMetaType *types,
int argc)
const
133 QV4::Lookup *lookup = compilationUnit->runtimeLookups + index;
134 QV4::Scope scope(engine->handle());
135 QV4::ScopedFunctionObject function(scope, lookup->globalGetter(scope.engine));
137 scope.engine->throwTypeError(
138 QStringLiteral(
"Property '%1' of object [null] is not a function")
139 .arg(compilationUnit->runtimeStrings[lookup->nameIndex]->toQString()));
143 function->call(
nullptr, args, types, argc);
147void QQmlPrivate::AOTCompiledContext::initCallGlobalLookup(uint index)
const
150 Q_ASSERT(engine->hasError());
151 engine->handle()->amendException();
154void QQmlPrivate::AOTCompiledContext::initLoadScopeObjectPropertyLookup(
155 uint index, QMetaType type)
const
158 return initLoadScopeObjectPropertyLookup(index);
161void QQmlPrivate::AOTCompiledContext::initGetObjectLookup(
162 uint index, QObject *object, QMetaType type)
const
164 return type == QMetaType::fromType<QVariant>()
165 ? initGetObjectLookupAsVariant(index, object)
166 : initGetObjectLookup(index, object);
169void QQmlPrivate::AOTCompiledContext::initSetObjectLookup(
170 uint index, QObject *object, QMetaType type)
const
172 return type == QMetaType::fromType<QVariant>()
173 ? initSetObjectLookupAsVariant(index, object)
174 : initSetObjectLookup(index, object);
177void QQmlPrivate::AOTCompiledContext::initGetValueLookup(
178 uint index,
const QMetaObject *metaObject, QMetaType type)
const {
180 initGetValueLookup(index, metaObject);
183void QQmlPrivate::AOTCompiledContext::initSetValueLookup(
184 uint index,
const QMetaObject *metaObject, QMetaType type)
const
187 initSetValueLookup(index, metaObject);