Qt
6.x
The Qt SDK
Loading...
Searching...
No Matches
qqmlvaluetypewrapper_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 QQMLVALUETYPEWRAPPER_P_H
5
#define QQMLVALUETYPEWRAPPER_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 <private/qtqmlglobal_p.h>
20
21
#include <private/qv4referenceobject_p.h>
22
#include <private/qqmlpropertycache_p.h>
23
#include <private/qqmltype_p_p.h>
24
#include <private/qqmltypewrapper_p.h>
25
#include <private/qv4object_p.h>
26
#include <private/qv4qobjectwrapper_p.h>
27
#include <private/qv4sequenceobject_p.h>
28
#include <private/qv4value_p.h>
29
#include <private/qv4referenceobject_p.h>
30
31
QT_BEGIN_NAMESPACE
32
33
class
QQmlValueType
;
34
35
namespace
QV4
{
36
37
namespace
Heap {
38
39
#define QQmlValueTypeWrapperMembers(class, Member)
40
41
DECLARE_HEAP_OBJECT
(
QQmlValueTypeWrapper
,
ReferenceObject
) {
42
DECLARE_MARKOBJECTS
(
QQmlValueTypeWrapper
);
43
44
void
init
(
45
const
void
*
data
,
QMetaType
metaType,
const
QMetaObject
*
metaObject
,
46
Object
*
object
,
int
property
,
Flags
flags
)
47
{
48
ReferenceObject::init(
object
,
property
,
flags
);
49
setMetaType(metaType);
50
setMetaObject(
metaObject
);
51
if
(
data
)
52
setData
(
data
);
53
}
54
55
QQmlValueTypeWrapper
*detached()
const
;
56
57
void
destroy();
58
59
QMetaType
metaType()
const
60
{
61
Q_ASSERT
(m_metaType !=
nullptr
);
62
return
QMetaType
(m_metaType);
63
}
64
65
void
setGadgetPtr(
void
*gadgetPtr) { m_gadgetPtr = gadgetPtr; }
66
void
*gadgetPtr()
const
{
return
m_gadgetPtr; }
67
68
const
QMetaObject
*
metaObject
()
const
{
return
m_metaObject; }
69
70
void
setData
(
const
void
*
data
)
71
{
72
const
QMetaType
type
= metaType();
73
void
*gadget = gadgetPtr();
74
if
(gadget) {
75
type
.destruct(gadget);
76
}
else
{
77
gadget = ::operator
new
(
type
.sizeOf());
78
setGadgetPtr(gadget);
79
}
80
type
.construct(gadget,
data
);
81
}
82
83
QVariant
toVariant
()
const
;
84
85
void
*storagePointer();
86
bool
setVariant(
const
QVariant
&
variant
);
87
88
bool
readReference();
89
bool
writeBack(
int
propertyIndex =
QV4::ReferenceObject::AllProperties
);
90
91
private
:
92
void
setMetaObject(
const
QMetaObject
*
metaObject
) { m_metaObject =
metaObject
; }
93
void
setMetaType(
QMetaType
metaType)
94
{
95
Q_ASSERT
(metaType.
isValid
());
96
m_metaType = metaType.
iface
();
97
}
98
99
void
*m_gadgetPtr;
100
const
QtPrivate::QMetaTypeInterface
*m_metaType;
101
const
QMetaObject
*m_metaObject;
102
};
103
104
}
105
106
struct
Q_QML_EXPORT
QQmlValueTypeWrapper
:
public
ReferenceObject
107
{
108
V4_OBJECT2
(
QQmlValueTypeWrapper
,
ReferenceObject
)
109
V4_PROTOTYPE
(valueTypeWrapperPrototype)
110
V4_NEEDS_DESTROY
111
112
public
:
113
114
static
ReturnedValue
create
(
115
ExecutionEngine
*
engine
,
const
void
*
data
,
const
QMetaObject
*
metaObject
,
116
QMetaType
type
, Heap::Object *
object
,
int
property
, Heap::ReferenceObject::Flags
flags
);
117
static
ReturnedValue
create
(
118
ExecutionEngine
*
engine
, Heap::QQmlValueTypeWrapper *cloneFrom, Heap::Object *
object
);
119
static
ReturnedValue
create
(
120
ExecutionEngine
*
engine
,
const
void
*,
const
QMetaObject
*
metaObject
,
QMetaType
type
);
121
122
QVariant
toVariant
()
const
;
123
bool
toGadget(
void
*
data
)
const
;
124
bool
isEqual
(
const
QVariant
&
value
)
const
;
125
int
typeId()
const
;
126
QMetaType
type
()
const
;
127
bool
write
(
QObject
*
target
,
int
propertyIndex)
const
;
128
bool
readReferenceValue
()
const
{
return
d
()->readReference(); }
129
const
QMetaObject
*
metaObject
()
const
{
return
d
()->metaObject(); }
130
131
QQmlPropertyData
dataForPropertyKey(
PropertyKey
id
)
const
;
132
133
static
ReturnedValue
virtualGet(
const
Managed
*
m
,
PropertyKey
id
,
const
Value
*receiver,
bool
*hasProperty);
134
static
bool
virtualPut(
Managed
*
m
,
PropertyKey
id
,
const
Value
&
value
,
Value
*receiver);
135
static
bool
virtualIsEqualTo(
Managed
*
m
,
Managed
*
other
);
136
static
bool
virtualHasProperty(
const
Managed
*
m
,
PropertyKey
id
);
137
static
PropertyAttributes
virtualGetOwnProperty(
const
Managed
*
m
,
PropertyKey
id
,
Property
*
p
);
138
static
OwnPropertyKeyIterator
*virtualOwnPropertyKeys(
const
Object
*
m
,
Value
*
target
);
139
static
ReturnedValue
method_toString(
const
FunctionObject
*
b
,
const
Value
*thisObject,
const
Value
*argv,
int
argc);
140
static
ReturnedValue
virtualResolveLookupGetter(
const
Object
*
object
,
ExecutionEngine
*
engine
,
Lookup
*lookup);
141
static
bool
virtualResolveLookupSetter(
Object
*
object
,
ExecutionEngine
*
engine
,
Lookup
*lookup,
const
Value
&
value
);
142
static
ReturnedValue
lookupGetter(
Lookup
*lookup,
ExecutionEngine
*
engine
,
const
Value
&
object
);
143
static
bool
lookupSetter(
QV4::Lookup
*l,
QV4::ExecutionEngine
*
engine
,
144
QV4::Value
&
object
,
const
QV4::Value
&
value
);
145
146
static
void
initProto(
ExecutionEngine
*v4);
147
static
int
virtualMetacall(
Object
*
object
,
QMetaObject::Call
call,
int
index
,
void
**
a
);
148
};
149
150
}
151
152
QT_END_NAMESPACE
153
154
#endif
// QV8VALUETYPEWRAPPER_P_H
155
156
isEqual
static bool isEqual(const aiUVTransform &a, const aiUVTransform &b)
Definition
assimpimporter_rt.cpp:69
QMetaType
\inmodule QtCore
Definition
qmetatype.h:320
QMetaType::iface
const QtPrivate::QMetaTypeInterface * iface() const
Definition
qmetatype.h:750
QMetaType::isValid
bool isValid() const
Definition
qmetatype.cpp:521
QObject
\inmodule QtCore
Definition
qobject.h:90
QQmlPropertyData
Definition
qqmlpropertydata_p.h:26
QQmlValueType
Definition
qqmlvaluetype_p.h:34
QVariant
\inmodule QtCore
Definition
qvariant.h:64
QtPrivate::QMetaTypeInterface
Definition
qmetatype.h:247
QT_BEGIN_NAMESPACE
Combined button and popup list for selecting options.
Definition
qstandardpaths_haiku.cpp:21
QT_END_NAMESPACE
Definition
qsharedpointer.cpp:1545
QV4
\qmltype Particle \inqmlmodule QtQuick.Particles
Definition
qquickv4particledata.cpp:234
QV4::ReturnedValue
quint64 ReturnedValue
Definition
qv4staticvalue_p.h:38
value
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
Definition
qeglstreamconvenience_p.h:46
Flags
Flags
Definition
qfontsubset.cpp:650
b
GLboolean GLboolean GLboolean b
Definition
qopengles2ext.h:337
m
const GLfloat * m
Definition
qopengles2ext.h:3203
a
GLboolean GLboolean GLboolean GLboolean a
[7]
Definition
qopengles2ext.h:337
index
GLuint index
[2]
Definition
qopengles2ext.h:331
type
GLenum type
Definition
qopengles2ext.h:150
target
GLenum target
Definition
qopengles2ext.h:751
flags
GLbitfield flags
Definition
qopengles2ext.h:1026
data
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
Definition
qopengles2ext.h:206
p
GLfloat GLfloat p
[1]
Definition
qopenglext.h:12698
Q_ASSERT
#define Q_ASSERT(cond)
Definition
qrandom.cpp:47
init
static QT_BEGIN_NAMESPACE void init(QTextBoundaryFinder::BoundaryType type, QStringView str, QCharAttributes *attributes)
Definition
qtextboundaryfinder.cpp:10
toVariant
static QVariant toVariant(const QV4::Value &value, QMetaType typeHint, bool createJSValueForObjectsAndSymbols, V4ObjectSet *visitedObjects)
Definition
qv4engine.cpp:1494
V4_NEEDS_DESTROY
#define V4_NEEDS_DESTROY
Definition
qv4managed_p.h:39
DECLARE_HEAP_OBJECT
#define DECLARE_HEAP_OBJECT(name, base)
Definition
qv4mmdefs_p.h:313
DECLARE_MARKOBJECTS
#define DECLARE_MARKOBJECTS(class)
Definition
qv4mmdefs_p.h:320
V4_PROTOTYPE
#define V4_PROTOTYPE(p)
Definition
qv4vtable_p.h:256
V4_OBJECT2
#define V4_OBJECT2(DataClass, superClass)
Definition
qv4vtable_p.h:237
property
const char property[13]
Definition
qwizard.cpp:101
write
gzip write("uncompressed data")
setData
mimeData setData("text/csv", csvData)
metaObject
obj metaObject() -> className()
variant
QVariant variant
[1]
Definition
src_corelib_kernel_qvariant.cpp:30
d
double d
Definition
src_corelib_text_qlocale.cpp:9
other
QSharedPointer< T > other(t)
[5]
create
view create()
engine
QJSEngine engine
[0]
Definition
src_script_qjsvalue.cpp:14
QMetaObject
\inmodule QtCore
Definition
qobjectdefs.h:226
QMetaObject::Call
Call
Definition
qobjectdefs.h:467
QV4::ExecutionEngine
Definition
qv4engine_p.h:135
QV4::FunctionObject
Definition
qv4functionobject_p.h:137
QV4::Lookup
Definition
qv4lookup_p.h:34
QV4::Managed
Definition
qv4managed_p.h:73
QV4::Object
Definition
qv4object_p.h:104
QV4::OwnPropertyKeyIterator
Definition
qv4vtable_p.h:27
QV4::PropertyAttributes
Definition
qv4global_p.h:193
QV4::PropertyKey
Definition
qv4propertykey_p.h:28
QV4::Property
Definition
qv4property_p.h:26
QV4::QQmlValueTypeWrapper
Definition
qqmlvaluetypewrapper_p.h:107
QV4::QQmlValueTypeWrapper::metaObject
const QMetaObject * metaObject() const
Definition
qqmlvaluetypewrapper_p.h:129
QV4::QQmlValueTypeWrapper::readReferenceValue
bool readReferenceValue() const
Definition
qqmlvaluetypewrapper_p.h:128
QV4::ReferenceObject
Definition
qv4referenceobject_p.h:109
QV4::ReferenceObject::AllProperties
static constexpr const int AllProperties
Definition
qv4referenceobject_p.h:114
QV4::Value
Definition
qv4value_p.h:38
qtdeclarative
src
qml
qml
qqmlvaluetypewrapper_p.h
Generated by
1.9.7