17#include <private/qqmlengine_p.h>
18#include <private/qqmllistwrapper_p.h>
19#include <private/qqmlvaluetype_p.h>
20#include <private/qqmlvaluetypewrapper_p.h>
21#include <private/qv4alloca_p.h>
22#include <private/qv4context_p.h>
23#include <private/qv4dateobject_p.h>
24#include <private/qv4function_p.h>
25#include <private/qv4functionobject_p.h>
26#include <private/qv4object_p.h>
27#include <private/qv4qobjectwrapper_p.h>
28#include <private/qv4regexpobject_p.h>
29#include <private/qv4scopedvalue_p.h>
30#include <private/qv4stackframe_p.h>
31#include <private/qv4urlobject_p.h>
32#include <private/qv4variantobject_p.h>
34#if QT_CONFIG(regularexpression)
35#include <QtCore/qregularexpression.h>
42template<
typename Args>
56 ptr->function =
f->asReturnedValue();
114template<
typename Callable>
117 const Value *thisObject,
const Value *argv,
int argc, Callable call)
125 types[
i + 1] = argumentType;
147 call(cppThisObject->object(),
values,
types, argc);
165template<
typename Callable>
172 for (
int ii = 0; ii < argc; ++ii)
185 ScopedValue jsResult(scope, call(jsThisObject, jsCallData.
args, argc));
197 if (resultType == QMetaType::fromType<QVariant>()) {
236 const auto metaSequence = [&]() {
246 if (sequence->d()->listType() ==
type)
247 return value.asReturnedValue();
251 if (
list->d()->propertyType() ==
type)
252 return value.asReturnedValue();
256 if (!listValueType.
isValid()) {
258 return value.asReturnedValue();
288 sequence->containerPutIndexed(
i,
array->get(
i));
303 if (!
value.isUndefined())
305 return value.asReturnedValue();
308 switch (metaType.
id()) {
309 case QMetaType::Void:
312 return value.asReturnedValue();
315 case QMetaType::Double:
316 return value.convertedToNumber();
317 case QMetaType::QString:
319 case QMetaType::Bool:
321 case QMetaType::QDateTime:
323 return value.asReturnedValue();
327 case QMetaType::QDateTime:
329 case QMetaType::QTime:
331 case QMetaType::QDate:
338 case QMetaType::QUrl:
340 return value.asReturnedValue();
343 return var.
metaType() == QMetaType::fromType<QUrl>()
345 :
engine->newUrlObject()->asReturnedValue();
350 return engine->newUrlObject()->asReturnedValue();
351#if QT_CONFIG(regularexpression)
352 case QMetaType::QRegularExpression:
354 return value.asReturnedValue();
357 if (
var.
metaType() == QMetaType::fromType<QRegularExpression>())
360 return engine->newRegExpObject(
QString(), 0)->asReturnedValue();
368 ?
value.asReturnedValue()
373 if (
wrapper->type() == metaType)
374 return value.asReturnedValue();
380 nullptr, -1, Heap::ReferenceObject::NoFlag);
383 return wrapper->asReturnedValue();
389template<
typename Callable>
393 const Value *thisObject,
const Value *argv,
int argc, Callable call)
\inmodule QtCore\reentrant
\inmodule QtCore \reentrant
QJSValue globalObject() const
Returns this engine's Global Object.
qsizetype size() const noexcept
The QQmlListProperty class allows applications to expose list-like properties of QObject-derived clas...
bool isSequentialContainer() const
QMetaSequence listMetaSequence() const
QMetaType qListTypeId() const
static Q_QML_PRIVATE_EXPORT void * heapCreateValueType(const QQmlType &targetType, const QV4::Value &source)
\inmodule QtCore \reentrant
\macro QT_RESTRICTED_CAST_FROM_ASCII
\inmodule QtCore \reentrant
QMetaType metaType() const
Combined button and popup list for selecting options.
\qmltype Particle \inqmlmodule QtQuick.Particles
ReturnedValue coerceListType(ExecutionEngine *engine, const Value &value, const QQmlType &qmlType)
ReturnedValue convertAndCall(ExecutionEngine *engine, const QQmlPrivate::AOTCompiledFunction *aotFunction, const Value *thisObject, const Value *argv, int argc, Callable call)
CallData * callDatafromJS(const Scope &scope, const Args *args, const FunctionObject *f=nullptr)
ReturnedValue coerce(ExecutionEngine *engine, const Value &value, const QQmlType &qmlType, bool isList)
ReturnedValue coerceAndCall(ExecutionEngine *engine, const Function::JSTypedFunction *typedFunction, const CompiledData::Function *compiledFunction, const Value *thisObject, const Value *argv, int argc, Callable call)
void populateJSCallArguments(ExecutionEngine *v4, JSCallArguments &jsCall, int argc, void **args, const QMetaType *types)
QObject * coerceQObject(const Value &value, const QQmlType &qmlType)
Q_QML_PRIVATE_EXPORT void warnAboutCoercionToVoid(ExecutionEngine *engine, const Value &value, CoercionProblem problem)
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
static ControlElement< T > * ptr(QWidget *widget)
GLenum GLsizei GLsizei GLint * values
[15]
GLsizei const GLfloat * v
[13]
GLboolean GLboolean GLboolean GLboolean a
[7]
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLsizei GLenum GLenum * types
GLenum GLuint GLenum GLsizei length
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLsizei const GLchar *const * string
[0]
bool qmlobject_can_qml_cast(QObject *object, const QQmlType &type)
#define Q_ALLOCA_VAR(type, name, size)
#define Q_ALLOCA_ASSIGN(type, name, size)
#define Q_ALLOCA_DECLARE(type, name)
QList< QMetaType > argumentTypes
const Parameter * formalsTable() const
static constexpr ReturnedValue undefined()
static constexpr ReturnedValue null()
static bool metaTypeFromJS(const Value &value, QMetaType type, void *data)
static QVariant toVariant(const QV4::Value &value, QMetaType typeHint, bool createJSValueForObjectsAndSymbols=true)
ReturnedValue call(const JSCallData &data) const
ReturnedValue callAsConstructor(const JSCallData &data) const
QList< QQmlType > argumentTypes
JSCallArguments(const Scope &scope, int argc=0)
CallData * callData(const Scope &scope, const FunctionObject *f=nullptr) const
CallData * callData(const Scope &scope, const FunctionObject *f=nullptr) const
JSCallData(const Value *thisObject, const Value *argv, int argc)
Q_IMPLICIT JSCallData(const JSCallArguments &args)
static ReturnedValue wrap(ExecutionEngine *engine, QObject *object)
static V4_NEEDS_DESTROY ReturnedValue create(ExecutionEngine *engine, QObject *object, int propId, QMetaType propType)
Value * alloc(qint64 nValues) const =delete
bool hasException() const
QML_NEARLY_ALWAYS_INLINE ReturnedValue asReturnedValue() const
static ReturnedValue fromData(QV4::ExecutionEngine *engine, QMetaType type, QMetaSequence metaSequence, const void *data)
QML_NEARLY_ALWAYS_INLINE String * stringValue() const
uchar data[MaxInternalSize]