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
5
6#include <private/qqmlobjectorgadget_p.h>
7#include <private/qv4jscall_p.h>
8#include <private/qv4qobjectwrapper_p.h>
9
11
12using namespace Qt::StringLiterals;
13
14namespace QV4 {
15
16void Heap::QMetaObjectWrapper::init(const QMetaObject *metaObject)
17{
18 FunctionObject::init();
19 m_metaObject = metaObject;
20}
21
23{
24 delete[] m_constructors;
25 FunctionObject::destroy();
26}
27
35
37 const QMetaObject &mo = *d()->metaObject();
38
39 for (int i = 0; i < mo.enumeratorCount(); i++) {
41 for (int k = 0; k < Enum.keyCount(); k++) {
42 const char* key = Enum.key(k);
43 const int value = Enum.value(k);
45 }
46 }
47}
48
50{
52 return construct(static_cast<const QMetaObjectWrapper*>(f)->d(), argv, argc);
53}
54
57 const Value *argv, int argc)
58{
60
61 if (!constructors) {
63 + QLatin1String(" has no invokable constructor"));
64 }
65
66 Scope scope(v4);
68 JSCallData cData(nullptr, argv, argc);
70
72
73 const auto callType = [](QMetaType metaType) {
77 };
78
80 if (constructorCount == 1) {
88 }
89
90 if (object) {
94 }
95
96 return object.asReturnedValue();
97}
98
106
108
109} // namespace QV4
110
111QT_END_NAMESPACE
Combined button and popup list for selecting options.
Definition qjsvalue.h:23
void init(const QMetaObject *metaObject)