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
namespace
QV4
{
29
30
struct
QQmlContextWrapper;
31
32
namespace
Heap
{
33
34
#
define
QQmlContextWrapperMembers
(
class
,
Member
)
35
Member
(
class
,
Pointer
,
Module
*
,
module
)
36
37
DECLARE_HEAP_OBJECT(QQmlContextWrapper, Object) {
38
DECLARE_MARKOBJECTS(QQmlContextWrapper)
39
40
void
init(QQmlRefPointer<QQmlContextData> context, QObject *scopeObject);
41
void
destroy();
42
43
// This has to be a plain pointer because object needs to be a POD type.
44
QQmlContextData *context;
45
QV4QPointer<QObject> scopeObject;
46
};
47
48
#
define
QmlContextMembers
(
class
,
Member
)
49
50
DECLARE_HEAP_OBJECT(QmlContext, ExecutionContext) {
51
DECLARE_MARKOBJECTS(QmlContext)
52
53
QQmlContextWrapper *qml() {
return
static_cast
<QQmlContextWrapper *>(activation.get()); }
54
void
init(
QV4
::ExecutionContext *outerContext,
QV4
::QQmlContextWrapper *qml);
55
};
56
57
}
58
59
struct
Q_QML_EXPORT
QQmlContextWrapper
:
Object
60
{
61
V4_OBJECT2
(
QQmlContextWrapper
,
Object
)
62
V4_NEEDS_DESTROY
63
V4_INTERNALCLASS
(
QmlContextWrapper
)
64
65
inline
QObject
*
getScopeObject
()
const
{
return
d
()->
scopeObject
; }
66
inline
QQmlRefPointer
<
QQmlContextData
>
getContext
()
const
{
return
d
()->
context
; }
67
68
static
ReturnedValue
getPropertyAndBase
(
const
QQmlContextWrapper
*
resource
,
PropertyKey
id
,
const
Value
*
receiver
,
69
bool
*
hasProperty
,
Value
*
base
,
Lookup
*
lookup
=
nullptr
);
70
static
ReturnedValue
virtualGet
(
const
Managed
*
m
,
PropertyKey
id
,
const
Value
*
receiver
,
bool
*
hasProperty
);
71
static
bool
virtualPut
(
Managed
*
m
,
PropertyKey
id
,
const
Value
&
value
,
Value
*
receiver
);
72
73
static
ReturnedValue
resolveQmlContextPropertyLookupGetter
(
Lookup
*
l
,
ExecutionEngine
*
engine
,
Value
*
base
);
74
static
ReturnedValue
lookupScript
(
Lookup
*
l
,
ExecutionEngine
*
engine
,
Value
*
base
);
75
static
ReturnedValue
lookupSingleton
(
Lookup
*
l
,
ExecutionEngine
*
engine
,
Value
*
base
);
76
static
ReturnedValue
lookupValueSingleton
(
Lookup
*
l
,
ExecutionEngine
*
engine
,
Value
*
base
);
77
static
ReturnedValue
lookupIdObject
(
Lookup
*
l
,
ExecutionEngine
*
engine
,
Value
*
base
);
78
static
ReturnedValue
lookupIdObjectInParentContext
(
Lookup
*
l
,
ExecutionEngine
*
engine
,
Value
*
base
);
79
static
ReturnedValue
lookupScopeObjectProperty
(
Lookup
*
l
,
ExecutionEngine
*
engine
,
Value
*
base
);
80
static
ReturnedValue
lookupScopeObjectMethod
(
Lookup
*
l
,
ExecutionEngine
*
engine
,
Value
*
base
);
81
static
ReturnedValue
lookupScopeFallbackProperty
(
Lookup
*
l
,
ExecutionEngine
*
engine
,
Value
*
base
);
82
static
ReturnedValue
lookupContextObjectProperty
(
Lookup
*
l
,
ExecutionEngine
*
engine
,
Value
*
base
);
83
static
ReturnedValue
lookupContextObjectMethod
(
Lookup
*
l
,
ExecutionEngine
*
engine
,
Value
*
base
);
84
static
ReturnedValue
lookupInGlobalObject
(
Lookup
*
l
,
ExecutionEngine
*
engine
,
Value
*
base
);
85
static
ReturnedValue
lookupInParentContextHierarchy
(
Lookup
*
l
,
ExecutionEngine
*
engine
,
Value
*
base
);
86
static
ReturnedValue
lookupType
(
Lookup
*
l
,
ExecutionEngine
*
engine
,
Value
*
base
);
87
};
88
89
struct
Q_QML_EXPORT
QmlContext
:
public
ExecutionContext
90
{
91
V4_MANAGED
(
QmlContext
,
ExecutionContext
)
92
V4_INTERNALCLASS
(
QmlContext
)
93
94
static
Heap
::
QmlContext
*
create
(
95
QV4
::
ExecutionContext
*
parent
,
QQmlRefPointer
<
QQmlContextData
>
context
,
96
QObject
*
scopeObject
);
97
98
QObject
*
qmlScope
()
const
{
99
return
d
()->
qml
()->
scopeObject
;
100
}
101
102
QQmlRefPointer
<
QQmlContextData
>
qmlContext
()
const
{
103
return
d
()->
qml
()->
context
;
104
}
105
};
106
107
}
108
109
QT_END_NAMESPACE
110
111
#
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:475
QV4::setupQObjectLookup
void setupQObjectLookup(Lookup *lookup, const QQmlData *ddata, const QQmlPropertyData *propertyData)
Definition
qv4lookup_p.h:456
QV4::qualifiesForMethodLookup
bool qualifiesForMethodLookup(const QQmlPropertyData *propertyData)
Definition
qv4lookup_p.h:499
QV4::setupQObjectMethodLookup
void setupQObjectMethodLookup(Lookup *lookup, const QQmlPropertyCache::ConstPtr &propertyCache, const QQmlPropertyData *propertyData, const Object *self, QObjectMethod *method)
Definition
qv4lookup_p.h:485
QV4::setupQObjectLookup
void setupQObjectLookup(Lookup *lookup, const QQmlData *ddata, const QQmlPropertyData *propertyData, const Object *self)
Definition
qv4lookup_p.h:466
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:90
qtdeclarative
src
qml
jsruntime
qv4qmlcontext_p.h
Generated on
for Qt by
1.18.0