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
qqmltypewrapper_p.h
Go to the documentation of this file.
1// Copyright (C) 2016 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
4#ifndef QV8TYPEWRAPPER_P_H
5#define QV8TYPEWRAPPER_P_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists purely as an
12// implementation detail. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16//
17
18#include <QtCore/qglobal.h>
19#include <QtCore/qpointer.h>
20
21#include <private/qv4value_p.h>
22#include <private/qv4object_p.h>
23
25
27class QQmlType;
28class QQmlTypePrivate;
29struct QQmlImportRef;
30
31namespace QV4 {
32
33namespace Heap {
34
36
42
43 enum Kind : quint8 {
44 Type = 0x0,
45 Namespace = 0x2,
46 KindMask = 0x2
47 };
48
51
52 void destroy();
53 QQmlType type() const;
55 Kind kind() const { return Kind(flags & KindMask); }
56
58 const QV4::String *name, QQmlEnginePrivate *enginePrivate) const;
59
60 QV4QPointer<QObject> object;
61
62 union {
63 struct {
65 const void *reserved;
66 } t;
67 struct {
70 } n;
71 };
72
74};
75
77 void init() { Object::init(); }
78 void destroy();
81 QQmlType type() const;
82};
83
84}
85
86struct Q_QML_EXPORT QQmlTypeWrapper : Object
87{
90
91 bool isSingleton() const;
92 const QMetaObject *metaObject() const;
93 QObject *object() const;
94 QObject *singletonObject() const;
95
96 QVariant toVariant() const;
97
99 Heap::QQmlTypeWrapper::TypeNameMode = Heap::QQmlTypeWrapper::IncludeEnums);
100 static ReturnedValue create(ExecutionEngine *, QObject *, const QQmlRefPointer<QQmlTypeNameCache> &, const QQmlImportRef *,
101 Heap::QQmlTypeWrapper::TypeNameMode = Heap::QQmlTypeWrapper::IncludeEnums);
102
103 static ReturnedValue virtualResolveLookupGetter(const Object *object, ExecutionEngine *engine, Lookup *lookup);
104 static bool virtualResolveLookupSetter(Object *object, ExecutionEngine *engine, Lookup *lookup, const Value &value);
105 static OwnPropertyKeyIterator *virtualOwnPropertyKeys(const Object *m, Value *target);
106 static int virtualMetacall(Object *object, QMetaObject::Call call, int index, void **a);
107
108 static ReturnedValue lookupSingletonProperty(Lookup *l, ExecutionEngine *engine, const Value &base);
109 static ReturnedValue lookupSingletonMethod(Lookup *l, ExecutionEngine *engine, const Value &base);
110 static ReturnedValue lookupEnumValue(Lookup *l, ExecutionEngine *engine, const Value &base);
111 static ReturnedValue lookupScopedEnum(Lookup *l, ExecutionEngine *engine, const Value &base);
112
113protected:
114 static ReturnedValue virtualGet(const Managed *m, PropertyKey id, const Value *receiver, bool *hasProperty);
115 static bool virtualPut(Managed *m, PropertyKey id, const Value &value, Value *receiver);
116 static PropertyAttributes virtualGetOwnProperty(const Managed *m, PropertyKey id, Property *p);
117 static bool virtualIsEqualTo(Managed *that, Managed *o);
118 static ReturnedValue virtualInstanceOf(const Object *typeObject, const Value &var);
119};
120
121struct Q_QML_EXPORT QQmlScopedEnumWrapper : Object
122{
125
126 static ReturnedValue virtualGet(const Managed *m, PropertyKey id, const Value *receiver, bool *hasProperty);
127};
128
129}
130
132
133#endif // QV8TYPEWRAPPER_P_H
134
\inmodule QtCore
Definition qobject.h:103
\inmodule QtCore
Definition qvariant.h:65
Combined button and popup list for selecting options.
quint64 ReturnedValue
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
const GLfloat * m
GLboolean GLboolean GLboolean GLboolean a
[7]
GLuint index
[2]
GLuint object
[3]
GLenum type
GLenum target
GLbitfield flags
GLuint name
GLfloat GLfloat p
[1]
unsigned char quint8
Definition qtypes.h:46
static const uint base
Definition qurlidna.cpp:20
static QVariant toVariant(const QV4::Value &value, QMetaType typeHint, JSToQVariantConversionBehavior conversionBehavior, V4ObjectSet *visitedObjects)
#define V4_NEEDS_DESTROY
#define V4_OBJECT2(DataClass, superClass)
obj metaObject() -> className()
view create()
QJSEngine engine
[0]
\inmodule QtCore
const QQmlTypePrivate * typePrivate
struct QV4::Heap::QQmlTypeWrapper::@673::@676 n
QQmlTypeNameCache * typeNamespace
const QQmlTypePrivate * typePrivate
void init(TypeNameMode m, QObject *o, const QQmlTypePrivate *type)
const QQmlImportRef * importNamespace
struct QV4::Heap::QQmlTypeWrapper::@673::@675 t
QQmlTypeNameCache::Result queryNamespace(const QV4::String *name, QQmlEnginePrivate *enginePrivate) const
QV4QPointer< QObject > object
TypeNameMode typeNameMode() const
Definition moc.h:23