Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Toggle main menu visibility
Loading...
Searching...
No Matches
qv4qmlcontext_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
// Qt-Security score:significant
4
5
#
ifndef
QV4QMLCONTEXT_P_H
6
#
define
QV4QMLCONTEXT_P_H
7
8
//
9
// W A R N I N G
10
// -------------
11
//
12
// This file is not part of the Qt API. It exists purely as an
13
// implementation detail. This header file may change from version to
14
// version without notice, or even be removed.
15
//
16
// We mean it.
17
//
18
19
#
include
<
private
/
qqmlcontextdata_p
.
h
>
20
#
include
<
private
/
qtqmlglobal_p
.
h
>
21
#
include
<
private
/
qv4context_p
.
h
>
22
#
include
<
private
/
qv4object_p
.
h
>
23
24
#
include
<
QtCore
/
qglobal
.
h
>
25
26
QT_BEGIN_NAMESPACE
27
28
class
QQmlPropertyCache;
29
30
namespace
QV4
{
31
32
struct
QQmlContextWrapper;
33
34
namespace
Heap
{
35
36
#
define
QQmlContextWrapperMembers
(
class
,
Member
)
37
Member
(
class
,
Pointer
,
Module
*
,
module
)
38
39
DECLARE_HEAP_OBJECT(QQmlContextWrapper, Object) {
40
DECLARE_MARKOBJECTS(QQmlContextWrapper)
41
42
void
init(QQmlRefPointer<QQmlContextData> context, QObject *scopeObject);
43
void
destroy();
44
45
// This has to be a plain pointer because object needs to be a POD type.
46
QQmlContextData *context;
47
QV4QPointer<QObject> scopeObject;
48
49
// The type of the scope object. It outlives the scope object, so that we can tell whether the
50
// scope object would have resolved a name even if it is gone. Held as a plain pointer with
51
// manual reference counting because the heap object needs to be a POD type.
52
const
QQmlPropertyCache *scopePropertyCache;
53
};
54
55
#
define
QmlContextMembers
(
class
,
Member
)
56
57
DECLARE_HEAP_OBJECT(QmlContext, ExecutionContext) {
58
DECLARE_MARKOBJECTS(QmlContext)
59
60
QQmlContextWrapper *qml() {
return
static_cast
<QQmlContextWrapper *>(activation.get()); }
61
void
init(
QV4
::ExecutionContext *outerContext,
QV4
::QQmlContextWrapper *qml);
62
};
63
64
}
65
66
struct
Q_QML_EXPORT
QQmlContextWrapper
:
Object
67
{
68
V4_OBJECT2
(
QQmlContextWrapper
,
Object
)
69
V4_NEEDS_DESTROY
70
V4_INTERNALCLASS
(
QmlContextWrapper
)
71
72
inline
QObject
*
getScopeObject
()
const
{
return
d
()->
scopeObject
; }
73
inline
QQmlRefPointer
<
QQmlContextData
>
getContext
()
const
{
return
d
()->
context
; }
74
75
static
ReturnedValue
getPropertyAndBase
(
const
QQmlContextWrapper
*
resource
,
PropertyKey
id
,
const
Value
*
receiver
,
76
bool
*
hasProperty
,
Value
*
base
,
Lookup
*
lookup
=
nullptr
);
77
static
ReturnedValue
virtualGet
(
const
Managed
*
m
,
PropertyKey
id
,
const
Value
*
receiver
,
bool
*
hasProperty
);
78
static
bool
virtualPut
(
Managed
*
m
,
PropertyKey
id
,
const
Value
&
value
,
Value
*
receiver
);
79
80
static
ReturnedValue
resolveQmlContextPropertyLookupGetter
(
Lookup
*
l
,
ExecutionEngine
*
engine
,
Value
*
base
);
81
static
ReturnedValue
lookupScript
(
Lookup
*
l
,
ExecutionEngine
*
engine
,
Value
*
base
);
82
static
ReturnedValue
lookupSingleton
(
Lookup
*
l
,
ExecutionEngine
*
engine
,
Value
*
base
);
83
static
ReturnedValue
lookupValueSingleton
(
Lookup
*
l
,
ExecutionEngine
*
engine
,
Value
*
base
);
84
static
ReturnedValue
lookupIdObject
(
Lookup
*
l
,
ExecutionEngine
*
engine
,
Value
*
base
);
85
static
ReturnedValue
lookupIdObjectInParentContext
(
Lookup
*
l
,
ExecutionEngine
*
engine
,
Value
*
base
);
86
static
ReturnedValue
lookupScopeObjectProperty
(
Lookup
*
l
,
ExecutionEngine
*
engine
,
Value
*
base
);
87
static
ReturnedValue
lookupScopeObjectMethod
(
Lookup
*
l
,
ExecutionEngine
*
engine
,
Value
*
base
);
88
static
ReturnedValue
lookupScopeFallbackProperty
(
Lookup
*
l
,
ExecutionEngine
*
engine
,
Value
*
base
);
89
static
ReturnedValue
lookupContextObjectProperty
(
Lookup
*
l
,
ExecutionEngine
*
engine
,
Value
*
base
);
90
static
ReturnedValue
lookupContextObjectMethod
(
Lookup
*
l
,
ExecutionEngine
*
engine
,
Value
*
base
);
91
static
ReturnedValue
lookupInGlobalObject
(
Lookup
*
l
,
ExecutionEngine
*
engine
,
Value
*
base
);
92
static
ReturnedValue
lookupInParentContextHierarchy
(
Lookup
*
l
,
ExecutionEngine
*
engine
,
Value
*
base
);
93
static
ReturnedValue
lookupType
(
Lookup
*
l
,
ExecutionEngine
*
engine
,
Value
*
base
);
94
};
95
96
struct
Q_QML_EXPORT
QmlContext
:
public
ExecutionContext
97
{
98
V4_MANAGED
(
QmlContext
,
ExecutionContext
)
99
V4_INTERNALCLASS
(
QmlContext
)
100
101
static
Heap
::
QmlContext
*
create
(
102
QV4
::
ExecutionContext
*
parent
,
QQmlRefPointer
<
QQmlContextData
>
context
,
103
QObject
*
scopeObject
);
104
105
QObject
*
qmlScope
()
const
{
106
return
d
()->
qml
()->
scopeObject
;
107
}
108
109
QQmlRefPointer
<
QQmlContextData
>
qmlContext
()
const
{
110
return
d
()->
qml
()->
context
;
111
}
112
};
113
114
}
115
116
QT_END_NAMESPACE
117
118
#
endif
QT_BEGIN_NAMESPACE
Combined button and popup list for selecting options.
Definition
qsequentialanimationgroup.cpp:47
QV4::Heap
Definition
qv4compileddata_p.h:76
QV4
Definition
qjsvalue.h:24
QV4::setupQObjectLookup
void setupQObjectLookup(Lookup *lookup, const QQmlData *ddata, const QQmlPropertyData *propertyData, const Object *self, const Object *qmlType)
Definition
qv4lookup_p.h:476
QV4::setupQObjectLookup
void setupQObjectLookup(Lookup *lookup, const QQmlData *ddata, const QQmlPropertyData *propertyData)
Definition
qv4lookup_p.h:457
QV4::qualifiesForMethodLookup
bool qualifiesForMethodLookup(const QQmlPropertyData *propertyData)
Definition
qv4lookup_p.h:500
QV4::setupQObjectMethodLookup
void setupQObjectMethodLookup(Lookup *lookup, const QQmlPropertyCache::ConstPtr &propertyCache, const QQmlPropertyData *propertyData, const Object *self, QObjectMethod *method)
Definition
qv4lookup_p.h:486
QV4::setupQObjectLookup
void setupQObjectLookup(Lookup *lookup, const QQmlData *ddata, const QQmlPropertyData *propertyData, const Object *self)
Definition
qv4lookup_p.h:467
setupProtoLookupTwoClasses
static void setupProtoLookupTwoClasses(Lookup *lookup, const Lookup &first, const Lookup &second)
Definition
qv4lookup.cpp:147
setupObjectLookupTwoClasses
static void setupObjectLookupTwoClasses(Lookup *lookup, const Lookup &first, const Lookup &second)
Definition
qv4lookup.cpp:133
V4_MANAGED
#define V4_MANAGED(DataClass, superClass)
Definition
qv4managed_p.h:53
V4_NEEDS_DESTROY
#define V4_NEEDS_DESTROY
Definition
qv4managed_p.h:40
V4_INTERNALCLASS
#define V4_INTERNALCLASS(c)
Definition
qv4managed_p.h:65
QV4::Lookup
Definition
qv4lookup_p.h:39
QV4::QmlContext
Definition
qv4qmlcontext_p.h:97
qtdeclarative
src
qml
jsruntime
qv4qmlcontext_p.h
Generated on
for Qt by
1.18.0