Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qv4qmetaobjectwrapper.cpp
Go to the documentation of this file.
1// Copyright (C) 2024 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// Qt-Security score:significant
4
6
7#include <private/qqmlobjectorgadget_p.h>
8#include <private/qv4jscall_p.h>
9#include <private/qv4qobjectwrapper_p.h>
10
12
13using namespace Qt::StringLiterals;
14
15namespace QV4 {
16
17void Heap::QMetaObjectWrapper::init(const QMetaObject *metaObject)
18{
19 FunctionObject::init();
20 m_metaObject = metaObject;
21}
22
24{
25 delete[] m_constructors;
26 FunctionObject::destroy();
27}
28
36
38 const QMetaObject &mo = *d()->metaObject();
39
40 for (int i = 0; i < mo.enumeratorCount(); i++) {
42 for (int k = 0; k < Enum.keyCount(); k++) {
43 const char* key = Enum.key(k);
44 const int value = Enum.value(k);
46 }
47 }
48}
49
51{
53 return construct(static_cast<const QMetaObjectWrapper*>(f)->d(), argv, argc);
54}
55
58 const Value *argv, int argc)
59{
61
62 if (!constructors) {
64 + QLatin1String(" has no invokable constructor"));
65 }
66
67 Scope scope(v4);
69 JSCallData cData(nullptr, argv, argc);
71
73
74 const auto callType = [](QMetaType metaType) {
78 };
79
81 if (constructorCount == 1) {
89 }
90
91 if (object) {
95 }
96
97 return object.asReturnedValue();
98}
99
107
109
110} // namespace QV4
111
112QT_END_NAMESPACE
Definition qjsvalue.h:23
void init(const QMetaObject *metaObject)