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
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
4
#ifndef QV4QMLCONTEXT_P_H
5
#define QV4QMLCONTEXT_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 <private/qqmlcontextdata_p.h>
19
#include <private/qtqmlglobal_p.h>
20
#include <private/qv4context_p.h>
21
#include <private/qv4object_p.h>
22
23
#include <QtCore/qglobal.h>
24
25
QT_BEGIN_NAMESPACE
26
27
namespace
QV4
{
28
29
struct
QQmlContextWrapper;
30
31
namespace
Heap {
32
33
#define QQmlContextWrapperMembers(class, Member) \
34
Member(class, Pointer, Module *, module)
35
36
DECLARE_HEAP_OBJECT
(
QQmlContextWrapper
,
Object
) {
37
DECLARE_MARKOBJECTS
(
QQmlContextWrapper
)
38
39
void
init
(QQmlRefPointer<QQmlContextData>
context
,
QObject
*scopeObject);
40
void
destroy();
41
42
// This has to be a plain pointer because object needs to be a POD type.
43
QQmlContextData
*
context
;
44
QV4QPointer<QObject> scopeObject;
45
};
46
47
#define QmlContextMembers(class, Member)
48
49
DECLARE_HEAP_OBJECT
(
QmlContext
,
ExecutionContext
) {
50
DECLARE_MARKOBJECTS
(
QmlContext
)
51
52
QQmlContextWrapper
*qml() {
return
static_cast<
QQmlContextWrapper
*
>
(activation.get()); }
53
void
init
(
QV4::ExecutionContext
*outerContext,
QV4::QQmlContextWrapper
*qml);
54
};
55
56
}
57
58
struct
Q_QML_EXPORT
QQmlContextWrapper
:
Object
59
{
60
V4_OBJECT2
(
QQmlContextWrapper
,
Object
)
61
V4_NEEDS_DESTROY
62
V4_INTERNALCLASS
(QmlContextWrapper)
63
64
inline
QObject
*getScopeObject()
const
{
return
d
()->scopeObject; }
65
inline
QQmlRefPointer<QQmlContextData>
getContext
()
const
{
return
d
()->context; }
66
67
static
ReturnedValue
getPropertyAndBase(
const
QQmlContextWrapper
*resource,
PropertyKey
id
,
const
Value
*receiver,
68
bool
*hasProperty,
Value
*
base
,
Lookup
*lookup =
nullptr
);
69
static
ReturnedValue
virtualGet(
const
Managed
*
m
,
PropertyKey
id
,
const
Value
*receiver,
bool
*hasProperty);
70
static
bool
virtualPut(
Managed
*
m
,
PropertyKey
id
,
const
Value
&
value
,
Value
*receiver);
71
72
static
ReturnedValue
resolveQmlContextPropertyLookupGetter(
Lookup
*l,
ExecutionEngine
*
engine
,
Value
*
base
);
73
static
ReturnedValue
lookupScript(
Lookup
*l,
ExecutionEngine
*
engine
,
Value
*
base
);
74
static
ReturnedValue
lookupSingleton(
Lookup
*l,
ExecutionEngine
*
engine
,
Value
*
base
);
75
static
ReturnedValue
lookupValueSingleton(
Lookup
*l,
ExecutionEngine
*
engine
,
Value
*
base
);
76
static
ReturnedValue
lookupIdObject(
Lookup
*l,
ExecutionEngine
*
engine
,
Value
*
base
);
77
static
ReturnedValue
lookupIdObjectInParentContext(
Lookup
*l,
ExecutionEngine
*
engine
,
Value
*
base
);
78
static
ReturnedValue
lookupScopeObjectProperty(
Lookup
*l,
ExecutionEngine
*
engine
,
Value
*
base
);
79
static
ReturnedValue
lookupScopeObjectMethod(
Lookup
*l,
ExecutionEngine
*
engine
,
Value
*
base
);
80
static
ReturnedValue
lookupScopeFallbackProperty(
Lookup
*l,
ExecutionEngine
*
engine
,
Value
*
base
);
81
static
ReturnedValue
lookupContextObjectProperty(
Lookup
*l,
ExecutionEngine
*
engine
,
Value
*
base
);
82
static
ReturnedValue
lookupContextObjectMethod(
Lookup
*l,
ExecutionEngine
*
engine
,
Value
*
base
);
83
static
ReturnedValue
lookupInGlobalObject(
Lookup
*l,
ExecutionEngine
*
engine
,
Value
*
base
);
84
static
ReturnedValue
lookupInParentContextHierarchy(
Lookup
*l,
ExecutionEngine
*
engine
,
Value
*
base
);
85
static
ReturnedValue
lookupType(
Lookup
*l,
ExecutionEngine
*
engine
,
Value
*
base
);
86
};
87
88
struct
Q_QML_EXPORT
QmlContext
:
public
ExecutionContext
89
{
90
V4_MANAGED
(
QmlContext
,
ExecutionContext
)
91
V4_INTERNALCLASS
(
QmlContext
)
92
93
static
Heap::QmlContext *
create
(
94
QV4::ExecutionContext
*parent, QQmlRefPointer<QQmlContextData>
context
,
95
QObject
*scopeObject);
96
97
QObject
*
qmlScope
()
const
{
98
return
d
()->qml()->scopeObject;
99
}
100
101
QQmlRefPointer<QQmlContextData>
qmlContext
()
const
{
102
return
d
()->qml()->context;
103
}
104
};
105
106
}
107
108
QT_END_NAMESPACE
109
110
#endif
111
QObject
\inmodule QtCore
Definition
qobject.h:103
QQmlContextData
Definition
qqmlcontextdata_p.h:34
QT_BEGIN_NAMESPACE
Combined button and popup list for selecting options.
Definition
qstandardpaths_haiku.cpp:21
QT_END_NAMESPACE
Definition
qsharedpointer.cpp:1590
QV4
Definition
qv4debugservice.h:28
QV4::ReturnedValue
quint64 ReturnedValue
Definition
qv4staticvalue_p.h:38
context
static void * context
Definition
qandroidaudiosource.cpp:42
value
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
Definition
qeglstreamconvenience_p.h:46
m
const GLfloat * m
Definition
qopengles2ext.h:3203
init
static QT_BEGIN_NAMESPACE void init(QTextBoundaryFinder::BoundaryType type, QStringView str, QCharAttributes *attributes)
Definition
qtextboundaryfinder.cpp:10
base
static const uint base
Definition
qurlidna.cpp:20
V4_MANAGED
#define V4_MANAGED(DataClass, superClass)
Definition
qv4managed_p.h:57
V4_NEEDS_DESTROY
#define V4_NEEDS_DESTROY
Definition
qv4managed_p.h:39
V4_INTERNALCLASS
#define V4_INTERNALCLASS(c)
Definition
qv4managed_p.h:68
DECLARE_HEAP_OBJECT
#define DECLARE_HEAP_OBJECT(name, base)
Definition
qv4mmdefs_p.h:326
DECLARE_MARKOBJECTS
#define DECLARE_MARKOBJECTS(class)
Definition
qv4mmdefs_p.h:333
V4_OBJECT2
#define V4_OBJECT2(DataClass, superClass)
Definition
qv4vtable_p.h:262
d
double d
Definition
src_corelib_text_qlocale.cpp:9
create
view create()
engine
QJSEngine engine
[0]
Definition
src_script_qjsvalue.cpp:14
QV4::ExecutionContext
Definition
qv4context_p.h:107
QV4::ExecutionEngine
Definition
qv4engine_p.h:136
QV4::Lookup
Definition
qv4lookup_p.h:38
QV4::Managed
Definition
qv4managed_p.h:73
QV4::Object
Definition
qv4object_p.h:104
QV4::PropertyKey
Definition
qv4propertykey_p.h:29
QV4::QQmlContextWrapper
Definition
qv4qmlcontext_p.h:59
QV4::QQmlContextWrapper::getContext
QQmlRefPointer< QQmlContextData > getContext() const
Definition
qv4qmlcontext_p.h:65
QV4::QmlContext
Definition
qv4qmlcontext_p.h:89
QV4::QmlContext::qmlContext
QQmlRefPointer< QQmlContextData > qmlContext() const
Definition
qv4qmlcontext_p.h:101
QV4::QmlContext::qmlScope
QObject * qmlScope() const
Definition
qv4qmlcontext_p.h:97
QV4::Value
Definition
qv4value_p.h:38
qtdeclarative
src
qml
jsruntime
qv4qmlcontext_p.h
Generated by
1.10.0