Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
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
27
28namespace QV4 {
29
30struct QQmlContextWrapper;
31
32namespace Heap {
33
34#define QQmlContextWrapperMembers(class, Member)
35 Member(class, Pointer, Module *, module)
36
37DECLARE_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
50DECLARE_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
60{
64
65 inline QObject *getScopeObject() const { return d()->scopeObject; }
66 inline QQmlRefPointer<QQmlContextData> getContext() const { return d()->context; }
67
69 bool *hasProperty, Value *base, Lookup *lookup = nullptr);
71 static bool virtualPut(Managed *m, PropertyKey id, const Value &value, Value *receiver);
72
87};
88
106
107}
108
109QT_END_NAMESPACE
110
111#endif
Definition qjsvalue.h:23
void setupQObjectMethodLookup(Lookup *lookup, const QQmlData *ddata, const QQmlPropertyData *propertyData, const Object *self, QObjectMethod *method)
void setupQObjectLookup(Lookup *lookup, const QQmlData *ddata, const QQmlPropertyData *propertyData, const Object *self, const Object *qmlType)
void setupQObjectLookup(Lookup *lookup, const QQmlData *ddata, const QQmlPropertyData *propertyData)
bool qualifiesForMethodLookup(const QQmlPropertyData *propertyData)
void setupQObjectLookup(Lookup *lookup, const QQmlData *ddata, const QQmlPropertyData *propertyData, const Object *self)
static void setupProtoLookupTwoClasses(Lookup *lookup, const Lookup &first, const Lookup &second)
static void setupObjectLookupTwoClasses(Lookup *lookup, const Lookup &first, const Lookup &second)
#define V4_MANAGED(DataClass, superClass)
#define V4_NEEDS_DESTROY
#define V4_INTERNALCLASS(c)