Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qv4jscall_p.h
Go to the documentation of this file.
1// Copyright (C) 2017 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3#ifndef QV4JSCALL_H
4#define QV4JSCALL_H
5
6//
7// W A R N I N G
8// -------------
9//
10// This file is not part of the Qt API. It exists purely as an
11// implementation detail. This header file may change from version to
12// version without notice, or even be removed.
13//
14// We mean it.
15//
16
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>
33
34#if QT_CONFIG(regularexpression)
35#include <QtCore/qregularexpression.h>
36#endif
37
39
40namespace QV4 {
41
42template<typename Args>
43CallData *callDatafromJS(const Scope &scope, const Args *args, const FunctionObject *f = nullptr)
44{
45 int size = int(offsetof(QV4::CallData, args)/sizeof(QV4::Value)) + args->argc;
46 CallData *ptr = reinterpret_cast<CallData *>(scope.alloc<Scope::Uninitialized>(size));
47 ptr->function = Encode::undefined();
48 ptr->context = Encode::undefined();
49 ptr->accumulator = Encode::undefined();
50 ptr->thisObject = args->thisObject ? args->thisObject->asReturnedValue() : Encode::undefined();
51 ptr->newTarget = Encode::undefined();
52 ptr->setArgc(args->argc);
53 if (args->argc)
54 memcpy(ptr->args, args->args, args->argc*sizeof(Value));
55 if (f)
56 ptr->function = f->asReturnedValue();
57 return ptr;
58}
59
61{
62 JSCallArguments(const Scope &scope, int argc = 0)
63 : thisObject(scope.alloc()), args(scope.alloc(argc)), argc(argc)
64 {
65 }
66
67 CallData *callData(const Scope &scope, const FunctionObject *f = nullptr) const
68 {
69 return callDatafromJS(scope, this, f);
70 }
71
74 const int argc;
75};
76
78{
79 JSCallData(const Value *thisObject, const Value *argv, int argc)
81 {
82 }
83
88
89 CallData *callData(const Scope &scope, const FunctionObject *f = nullptr) const
90 {
91 return callDatafromJS(scope, this, f);
92 }
93
95 const Value *args;
96 const int argc;
97};
98
99inline
101{
102 return callAsConstructor(data.args, data.argc, this);
103}
104
105inline
107{
108 return call(data.thisObject, data.args, data.argc);
109}
110
112 void **args, const QMetaType *types);
113
114template<typename Callable>
117 const Value *thisObject, const Value *argv, int argc, Callable call)
118{
119 const qsizetype numFunctionArguments = aotFunction->types.length() - 1;
120 Q_ALLOCA_VAR(void *, values, (numFunctionArguments + 1) * sizeof(void *));
121 Q_ALLOCA_VAR(QMetaType, types, (numFunctionArguments + 1) * sizeof(QMetaType));
122
123 for (qsizetype i = 0; i < numFunctionArguments; ++i) {
124 const QMetaType argumentType = aotFunction->types[i + 1];
125 types[i + 1] = argumentType;
126 if (const qsizetype argumentSize = argumentType.sizeOf()) {
127 Q_ALLOCA_VAR(void, argument, argumentSize);
128 if (argumentType.flags() & QMetaType::NeedsConstruction) {
129 argumentType.construct(argument);
130 if (i < argc)
131 ExecutionEngine::metaTypeFromJS(argv[i], argumentType, argument);
132 } else if (i >= argc
133 || !ExecutionEngine::metaTypeFromJS(argv[i], argumentType, argument)) {
134 // If we can't convert the argument, we need to default-construct it even if it
135 // doesn't formally need construction.
136 // E.g. an int doesn't need construction, but we still want it to be 0.
137 argumentType.construct(argument);
138 }
139
140 values[i + 1] = argument;
141 } else {
142 values[i + 1] = nullptr;
143 }
144 }
145
146 Q_ALLOCA_DECLARE(void, returnValue);
147 types[0] = aotFunction->types[0];
148 if (const qsizetype returnSize = types[0].sizeOf()) {
149 Q_ALLOCA_ASSIGN(void, returnValue, returnSize);
150 values[0] = returnValue;
152 types[0].construct(returnValue);
153 } else {
154 values[0] = nullptr;
155 }
156
157 if (const QV4::QObjectWrapper *cppThisObject = thisObject
158 ? thisObject->as<QV4::QObjectWrapper>()
159 : nullptr) {
160 call(cppThisObject->object(), values, types, argc);
161 } else {
162 call(nullptr, values, types, argc);
163 }
164
166 if (values[0]) {
167 result = engine->metaTypeToJS(types[0], values[0]);
169 types[0].destruct(values[0]);
170 } else {
172 }
173
174 for (qsizetype i = 1, end = numFunctionArguments + 1; i < end; ++i) {
176 types[i].destruct(values[i]);
177 }
178
179 return result;
180}
181
182template<typename Callable>
184 void **a, const QMetaType *types, int argc, Callable call)
185{
186 Scope scope(engine);
187 QV4::JSCallArguments jsCallData(scope, argc);
188
189 for (int ii = 0; ii < argc; ++ii)
190 jsCallData.args[ii] = engine->metaTypeToJS(types[ii + 1], a[ii + 1]);
191
192 ScopedObject jsThisObject(scope);
193 if (thisObject) {
194 // The result of wrap() can only be null, undefined, or an object.
195 jsThisObject = QV4::QObjectWrapper::wrap(engine, thisObject);
196 if (!jsThisObject)
197 jsThisObject = engine->globalObject;
198 } else {
199 jsThisObject = engine->globalObject;
200 }
201
202 ScopedValue jsResult(scope, call(jsThisObject, jsCallData.args, argc));
203 void *result = a[0];
204 if (!result)
205 return !jsResult->isUndefined();
206
207 const QMetaType resultType = types[0];
208 if (scope.hasException()) {
209 // Clear the return value
210 resultType.destruct(result);
211 resultType.construct(result);
212 } else if (resultType == QMetaType::fromType<QVariant>()) {
213 // When the return type is QVariant, JS objects are to be returned as
214 // QJSValue wrapped in QVariant. metaTypeFromJS unwraps them, unfortunately.
215 *static_cast<QVariant *>(result) = ExecutionEngine::toVariant(jsResult, QMetaType {});
216 } else if (!ExecutionEngine::metaTypeFromJS(jsResult, resultType, result)) {
217 // If we cannot convert, also clear the return value.
218 // The caller may have given us an uninitialized QObject*, expecting it to be overwritten.
219 resultType.destruct(result);
220 resultType.construct(result);
221 }
222 return !jsResult->isUndefined();
223}
224
225inline ReturnedValue coerce(
226 ExecutionEngine *engine, const Value &value, const QQmlType &qmlType, bool isList);
227
228inline QObject *coerceQObject(const Value &value, const QQmlType &qmlType)
229{
230 QObject *o;
232 o = wrapper->object();
234 o = wrapper->object();
235 else
236 return nullptr;
237
238 return (o && qmlobject_can_qml_cast(o, qmlType)) ? o : nullptr;
239}
240
246
247Q_QML_EXPORT void warnAboutCoercionToVoid(
248 ExecutionEngine *engine, const Value &value, CoercionProblem problem);
249
251 ExecutionEngine *engine, const Value &value, const QQmlType &qmlType)
252{
253 QMetaType type = qmlType.qListTypeId();
254 const auto metaSequence = [&]() {
255 // TODO: We should really add the metasequence to the same QQmlType that holds
256 // all the other type information. Then we can get rid of the extra
257 // QQmlMetaType::qmlListType() here.
258 return qmlType.isSequentialContainer()
259 ? qmlType.listMetaSequence()
260 : QQmlMetaType::qmlListType(type).listMetaSequence();
261 };
262
263 if (const QV4::Sequence *sequence = value.as<QV4::Sequence>()) {
264 if (sequence->d()->listType() == type)
265 return value.asReturnedValue();
266 }
267
268 if (const QmlListWrapper *list = value.as<QmlListWrapper>()) {
269 if (list->d()->propertyType() == type)
270 return value.asReturnedValue();
271 }
272
273 QMetaType listValueType = qmlType.typeId();
274 if (!listValueType.isValid()) {
276 return value.asReturnedValue();
277 }
278
279 QV4::Scope scope(engine);
280
282 if (!array) {
283 return (listValueType.flags() & QMetaType::PointerToQObject)
284 ? QmlListWrapper::create(engine, listValueType)
285 : SequencePrototype::fromData(engine, type, metaSequence(), nullptr);
286 }
287
288 if (listValueType.flags() & QMetaType::PointerToQObject) {
290 QQmlListProperty<QObject> *listProperty = newList->d()->property();
291
292 const qsizetype length = array->getLength();
293 qsizetype i = 0;
294 for (; i < length; ++i) {
295 ScopedValue v(scope, array->get(i));
296 listProperty->append(listProperty, coerceQObject(v, qmlType));
297 }
298
299 return newList->asReturnedValue();
300 }
301
302 QV4::Scoped<Sequence> sequence(
303 scope, SequencePrototype::fromData(engine, type, metaSequence(), nullptr));
304 const qsizetype length = array->getLength();
305 for (qsizetype i = 0; i < length; ++i)
306 sequence->containerPutIndexed(i, array->get(i));
307 return sequence->asReturnedValue();
308}
309
311 ExecutionEngine *engine, const Value &value, const QQmlType &qmlType, bool isList)
312{
313 // These are all the named non-list, non-QObject builtins. Only those need special handling.
314 // Some of them may be wrapped in VariantObject because that is how they are stored in VME
315 // properties.
316 if (isList)
317 return coerceListType(engine, value, qmlType);
318
319 const QMetaType metaType = qmlType.typeId();
320 if (!metaType.isValid()) {
321 if (!value.isUndefined())
323 return value.asReturnedValue();
324 }
325
326 switch (metaType.id()) {
327 case QMetaType::Void:
328 return Encode::undefined();
330 return value.asReturnedValue();
331 case QMetaType::Int:
332 return Encode(value.toInt32());
333 case QMetaType::Double:
334 return value.convertedToNumber();
335 case QMetaType::QString:
336 return value.toString(engine)->asReturnedValue();
337 case QMetaType::Bool:
338 return Encode(value.toBoolean());
339 case QMetaType::QDateTime:
340 if (value.as<DateObject>())
341 return value.asReturnedValue();
342 if (const VariantObject *varObject = value.as<VariantObject>()) {
343 const QVariant &var = varObject->d()->data();
344 switch (var.metaType().id()) {
345 case QMetaType::QDateTime:
346 return engine->newDateObject(var.value<QDateTime>())->asReturnedValue();
347 case QMetaType::QTime:
348 return engine->newDateObject(var.value<QTime>(), nullptr, -1, 0)->asReturnedValue();
349 case QMetaType::QDate:
350 return engine->newDateObject(var.value<QDate>(), nullptr, -1, 0)->asReturnedValue();
351 default:
352 break;
353 }
354 }
355 return engine->newDateObject(QDateTime())->asReturnedValue();
356 case QMetaType::QUrl:
357 if (value.as<UrlObject>())
358 return value.asReturnedValue();
359 if (const VariantObject *varObject = value.as<VariantObject>()) {
360 const QVariant &var = varObject->d()->data();
361 return var.metaType() == QMetaType::fromType<QUrl>()
362 ? engine->newUrlObject(var.value<QUrl>())->asReturnedValue()
363 : engine->newUrlObject()->asReturnedValue();
364 }
365 // Since URL properties are stored as string, we need to support the string conversion here.
366 if (const String *string = value.stringValue())
367 return engine->newUrlObject(QUrl(string->toQString()))->asReturnedValue();
368 return engine->newUrlObject()->asReturnedValue();
369#if QT_CONFIG(regularexpression)
370 case QMetaType::QRegularExpression:
371 if (value.as<RegExpObject>())
372 return value.asReturnedValue();
373 if (const VariantObject *varObject = value.as<VariantObject>()) {
374 const QVariant &var = varObject->d()->data();
375 if (var.metaType() == QMetaType::fromType<QRegularExpression>())
376 return engine->newRegExpObject(var.value<QRegularExpression>())->asReturnedValue();
377 }
378 return engine->newRegExpObject(QString(), 0)->asReturnedValue();
379#endif
380 default:
381 break;
382 }
383
384 if (metaType.flags() & QMetaType::PointerToQObject) {
385 return coerceQObject(value, qmlType)
386 ? value.asReturnedValue()
387 : Encode::null();
388 }
389
391 if (wrapper->type() == metaType)
392 return value.asReturnedValue();
393 }
394
396 Heap::QQmlValueTypeWrapper *wrapper = engine->memoryManager->allocate<QQmlValueTypeWrapper>(
397 nullptr, metaType, qmlType.metaObjectForValueType(),
398 nullptr, -1, Heap::ReferenceObject::NoFlag);
399 Q_ASSERT(!wrapper->gadgetPtr());
400 wrapper->setGadgetPtr(target);
401 return wrapper->asReturnedValue();
402 }
403
404 return Encode::undefined();
405}
406
407template<typename Callable>
410 const Function::JSTypedFunction *typedFunction, const CompiledData::Function *compiledFunction,
411 const Value *argv, int argc, Callable call)
412{
413 Scope scope(engine);
414
415 QV4::JSCallArguments jsCallData(scope, typedFunction->types.size() - 1);
416 const CompiledData::Parameter *formals = compiledFunction->formalsTable();
417 for (qsizetype i = 0; i < jsCallData.argc; ++i) {
418 jsCallData.args[i] = coerce(
419 engine, i < argc ? argv[i] : Encode::undefined(),
420 typedFunction->types[i + 1], formals[i].type.isList());
421 }
422
423 ScopedValue result(scope, call(jsCallData.args, jsCallData.argc));
424 return coerce(engine, result, typedFunction->types[0], compiledFunction->returnType.isList());
425}
426
427// Note: \a to is unininitialized here! This is in contrast to most other related functions.
428inline void coerce(
429 ExecutionEngine *engine, QMetaType fromType, const void *from, QMetaType toType, void *to)
430{
431 if ((fromType.flags() & QMetaType::PointerToQObject)
432 && (toType.flags() & QMetaType::PointerToQObject)) {
433 QObject *fromObj = *static_cast<QObject * const*>(from);
434 *static_cast<QObject **>(to)
435 = (fromObj && fromObj->metaObject()->inherits(toType.metaObject()))
436 ? fromObj
437 : nullptr;
438 return;
439 }
440
441 if (toType == QMetaType::fromType<QVariant>()) {
442 new (to) QVariant(fromType, from);
443 return;
444 }
445
446 if (toType == QMetaType::fromType<QJSPrimitiveValue>()) {
447 new (to) QJSPrimitiveValue(fromType, from);
448 return;
449 }
450
451 if (fromType == QMetaType::fromType<QVariant>()) {
452 const QVariant *fromVariant = static_cast<const QVariant *>(from);
453 if (fromVariant->metaType() == toType)
454 toType.construct(to, fromVariant->data());
455 else
456 coerce(engine, fromVariant->metaType(), fromVariant->data(), toType, to);
457 return;
458 }
459
460 if (fromType == QMetaType::fromType<QJSPrimitiveValue>()) {
461 const QJSPrimitiveValue *fromPrimitive = static_cast<const QJSPrimitiveValue *>(from);
462 if (fromPrimitive->metaType() == toType)
463 toType.construct(to, fromPrimitive->data());
464 else
465 coerce(engine, fromPrimitive->metaType(), fromPrimitive->data(), toType, to);
466 return;
467 }
468
469 // TODO: This is expensive. We might establish a direct C++-to-C++ type coercion, like we have
470 // for JS-to-JS. However, we shouldn't need this very often. Most of the time the compiler
471 // will generate code that passes the right arguments.
472 if (toType.flags() & QMetaType::NeedsConstruction)
473 toType.construct(to);
474 QV4::Scope scope(engine);
475 QV4::ScopedValue value(scope, engine->fromData(fromType, from));
476 if (!ExecutionEngine::metaTypeFromJS(value, toType, to))
477 QMetaType::convert(fromType, from, toType, to);
478}
479
480template<typename TypedFunction, typename Callable>
482 ExecutionEngine *engine, const TypedFunction *typedFunction,
483 void **argv, const QMetaType *types, int argc, Callable call)
484{
485 const qsizetype numFunctionArguments = typedFunction->parameterCount();
486
487 Q_ALLOCA_DECLARE(void *, transformedArguments);
488 Q_ALLOCA_DECLARE(void, transformedResult);
489
490 const QMetaType returnType = typedFunction->returnMetaType();
491 const QMetaType frameReturn = types[0];
492 bool returnsQVariantWrapper = false;
493 if (argv[0] && returnType != frameReturn) {
494 Q_ALLOCA_ASSIGN(void *, transformedArguments, (numFunctionArguments + 1) * sizeof(void *));
495 memcpy(transformedArguments, argv, (argc + 1) * sizeof(void *));
496
497 if (frameReturn == QMetaType::fromType<QVariant>()) {
498 QVariant *returnValue = static_cast<QVariant *>(argv[0]);
499 *returnValue = QVariant(returnType);
500 transformedResult = transformedArguments[0] = returnValue->data();
501 returnsQVariantWrapper = true;
502 } else if (returnType.sizeOf() > 0) {
503 Q_ALLOCA_ASSIGN(void, transformedResult, returnType.sizeOf());
504 transformedArguments[0] = transformedResult;
505 if (returnType.flags() & QMetaType::NeedsConstruction)
506 returnType.construct(transformedResult);
507 } else {
508 transformedResult = transformedArguments[0] = &argc; // Some non-null marker value
509 }
510 }
511
512 for (qsizetype i = 0; i < numFunctionArguments; ++i) {
513 const bool isValid = argc > i;
514 const QMetaType frameType = isValid ? types[i + 1] : QMetaType();
515
516 const QMetaType argumentType = typedFunction->parameterMetaType(i);
517 if (isValid && argumentType == frameType)
518 continue;
519
520 if (transformedArguments == nullptr) {
521 Q_ALLOCA_ASSIGN(void *, transformedArguments, (numFunctionArguments + 1) * sizeof(void *));
522 memcpy(transformedArguments, argv, (argc + 1) * sizeof(void *));
523 }
524
525 if (argumentType.sizeOf() == 0) {
526 transformedArguments[i + 1] = nullptr;
527 continue;
528 }
529
530 void *frameVal = isValid ? argv[i + 1] : nullptr;
531 if (isValid && frameType == QMetaType::fromType<QVariant>()) {
532 QVariant *variant = static_cast<QVariant *>(frameVal);
533
534 const QMetaType variantType = variant->metaType();
535 if (variantType == argumentType) {
536 // Slightly nasty, but we're allowed to do this.
537 // We don't want to destruct() the QVariant's data() below.
538 transformedArguments[i + 1] = argv[i + 1] = variant->data();
539 } else {
540 Q_ALLOCA_VAR(void, arg, argumentType.sizeOf());
541 coerce(engine, variantType, variant->constData(), argumentType, arg);
542 transformedArguments[i + 1] = arg;
543 }
544 continue;
545 }
546
547 Q_ALLOCA_VAR(void, arg, argumentType.sizeOf());
548
549 if (isValid)
550 coerce(engine, frameType, frameVal, argumentType, arg);
551 else
552 argumentType.construct(arg);
553
554 transformedArguments[i + 1] = arg;
555 }
556
557 if (!transformedArguments) {
558 call(argv, numFunctionArguments);
559 return;
560 }
561
562 call(transformedArguments, numFunctionArguments);
563
564 if (transformedResult && !returnsQVariantWrapper) {
565 if (frameReturn.sizeOf() > 0) {
566 if (frameReturn.flags() & QMetaType::NeedsDestruction)
567 frameReturn.destruct(argv[0]);
568 coerce(engine, returnType, transformedResult, frameReturn, argv[0]);
569 }
570 if (returnType.flags() & QMetaType::NeedsDestruction)
571 returnType.destruct(transformedResult);
572 }
573
574 for (qsizetype i = 0; i < numFunctionArguments; ++i) {
575 void *arg = transformedArguments[i + 1];
576 if (arg == nullptr)
577 continue;
578 if (i >= argc || arg != argv[i + 1]) {
579 const QMetaType argumentType = typedFunction->parameterMetaType(i);
580 if (argumentType.flags() & QMetaType::NeedsDestruction)
581 argumentType.destruct(arg);
582 }
583 }
584}
585
586} // namespace QV4
587
589
590#endif // QV4JSCALL_H
\inmodule QtCore\reentrant
Definition qdatetime.h:283
\inmodule QtCore \reentrant
Definition qdatetime.h:29
QJSValue globalObject() const
Returns this engine's Global Object.
The QJSPrimitiveValue class operates on primitive types in JavaScript semantics.
\inmodule QtCore
Definition qmetatype.h:341
void destruct(void *data) const
constexpr TypeFlags flags() const
Definition qmetatype.h:2658
constexpr qsizetype sizeOf() const
Definition qmetatype.h:2648
bool isValid() const
int id(int=0) const
Definition qmetatype.h:475
@ NeedsDestruction
Definition qmetatype.h:401
@ PointerToQObject
Definition qmetatype.h:406
@ NeedsConstruction
Definition qmetatype.h:400
void * construct(void *where, const void *copy=nullptr) const
static bool convert(QMetaType fromType, const void *from, QMetaType toType, void *to)
Converts the object at from from fromType to the preallocated space at to typed toType.
friend class QVariant
Definition qmetatype.h:796
\inmodule QtCore
Definition qobject.h:103
static QQmlType qmlListType(QMetaType metaType)
const QMetaObject * metaObjectForValueType() const
Definition qqmltype.cpp:688
QMetaType typeId() const
Definition qqmltype.cpp:668
bool isSequentialContainer() const
Definition qqmltype.cpp:658
QMetaSequence listMetaSequence() const
Definition qqmltype.cpp:678
QMetaType qListTypeId() const
Definition qqmltype.cpp:673
static Q_QML_EXPORT void * heapCreateValueType(const QQmlType &targetType, const QV4::Value &source)
\inmodule QtCore \reentrant
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
\inmodule QtCore \reentrant
Definition qdatetime.h:215
\inmodule QtCore
Definition qurl.h:94
\inmodule QtCore
Definition qvariant.h:65
void * data()
Returns a pointer to the contained object as a generic void* that can be written to.
T value() const &
Definition qvariant.h:516
Private d
Definition qvariant.h:672
QMetaType metaType() const
const void * constData() const
Definition qvariant.h:451
Combined button and popup list for selecting options.
ReturnedValue coerceListType(ExecutionEngine *engine, const Value &value, const QQmlType &qmlType)
ReturnedValue convertAndCall(ExecutionEngine *engine, const Function::AOTCompiledFunction *aotFunction, const Value *thisObject, const Value *argv, int argc, Callable call)
CoercionProblem
@ InvalidListType
@ InsufficientAnnotation
CallData * callDatafromJS(const Scope &scope, const Args *args, const FunctionObject *f=nullptr)
Definition qv4jscall_p.h:43
ReturnedValue coerce(ExecutionEngine *engine, const Value &value, const QQmlType &qmlType, bool isList)
quint64 ReturnedValue
void populateJSCallArguments(ExecutionEngine *v4, JSCallArguments &jsCall, int argc, void **args, const QMetaType *types)
Definition qv4jscall.cpp:18
QObject * coerceQObject(const Value &value, const QQmlType &qmlType)
ReturnedValue coerceAndCall(ExecutionEngine *engine, const Function::JSTypedFunction *typedFunction, const CompiledData::Function *compiledFunction, const Value *argv, int argc, Callable call)
Q_QML_EXPORT void warnAboutCoercionToVoid(ExecutionEngine *engine, const Value &value, CoercionProblem problem)
Definition qv4jscall.cpp:25
#define Q_IMPLICIT
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]
GLuint GLuint end
GLsizei GLenum GLenum * types
GLenum GLuint GLenum GLsizei length
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLfloat GLfloat f
GLenum type
GLenum target
GLbitfield flags
GLenum array
GLuint64EXT * result
[6]
GLsizei const GLchar *const * string
[0]
Definition qopenglext.h:694
bool qmlobject_can_qml_cast(QObject *object, const QQmlType &type)
#define Q_ASSERT(cond)
Definition qrandom.cpp:47
SSL_CTX int void * arg
ptrdiff_t qsizetype
Definition qtypes.h:165
#define Q_ALLOCA_VAR(type, name, size)
Definition qv4alloca_p.h:36
#define Q_ALLOCA_ASSIGN(type, name, size)
Definition qv4alloca_p.h:66
#define Q_ALLOCA_DECLARE(type, name)
Definition qv4alloca_p.h:62
QList< int > list
[14]
QVariant variant
[1]
QDBusArgument argument
QJSValueList args
QJSEngine engine
[0]
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 callAsConstructor(const Value *argv, int argc, const Value *newTarget=nullptr) const
ReturnedValue call(const Value *thisObject, const Value *argv, int argc) const
JSCallArguments(const Scope &scope, int argc=0)
Definition qv4jscall_p.h:62
CallData * callData(const Scope &scope, const FunctionObject *f=nullptr) const
Definition qv4jscall_p.h:67
const int argc
Definition qv4jscall_p.h:96
CallData * callData(const Scope &scope, const FunctionObject *f=nullptr) const
Definition qv4jscall_p.h:89
const Value * thisObject
Definition qv4jscall_p.h:94
JSCallData(const Value *thisObject, const Value *argv, int argc)
Definition qv4jscall_p.h:79
const Value * args
Definition qv4jscall_p.h:95
Q_IMPLICIT JSCallData(const JSCallArguments &args)
Definition qv4jscall_p.h:84
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
static ReturnedValue fromData(QV4::ExecutionEngine *engine, QMetaType type, QMetaSequence metaSequence, const void *data)
QML_NEARLY_ALWAYS_INLINE String * stringValue() const
Definition qv4value_p.h:55
const T * as() const
Definition qv4value_p.h:132
uchar data[MaxInternalSize]
Definition qvariant.h:112
void wrapper()