Qt
6.x
The Qt SDK
Loading...
Searching...
No Matches
qqmlcontext.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 QQMLCONTEXT_H
5
#define QQMLCONTEXT_H
6
7
#include <QtCore/qurl.h>
8
#include <QtCore/qobject.h>
9
#include <QtCore/qlist.h>
10
#include <QtCore/qpair.h>
11
#include <QtQml/qjsvalue.h>
12
#include <QtCore/qmetatype.h>
13
#include <QtCore/qvariant.h>
14
15
QT_BEGIN_NAMESPACE
16
17
18
class
QString
;
19
class
QQmlEngine
;
20
class
QQmlContextPrivate
;
21
class
QQmlCompositeTypeData;
22
class
QQmlContextData
;
23
24
class
Q_QML_EXPORT
QQmlContext
:
public
QObject
25
{
26
Q_OBJECT
27
Q_DECLARE_PRIVATE(
QQmlContext
)
28
29
public
:
30
struct
PropertyPair
{
QString
name
;
QVariant
value
; };
31
32
QQmlContext
(
QQmlEngine
*
parent
,
QObject
*objParent =
nullptr
);
33
QQmlContext
(
QQmlContext
*
parent
,
QObject
*objParent =
nullptr
);
34
~QQmlContext
()
override
;
35
36
bool
isValid()
const
;
37
38
QQmlEngine
*
engine
()
const
;
39
QQmlContext
*parentContext()
const
;
40
41
QObject
*contextObject()
const
;
42
void
setContextObject(
QObject
*);
43
44
QVariant
contextProperty(
const
QString
&)
const
;
45
void
setContextProperty(
const
QString
&,
QObject
*);
46
void
setContextProperty(
const
QString
&,
const
QVariant
&);
47
void
setContextProperties(
const
QList<PropertyPair>
&
properties
);
48
49
QString
nameForObject(
const
QObject
*)
const
;
50
QObject
*objectForName(
const
QString
&)
const
;
51
52
QUrl
resolvedUrl
(
const
QUrl
&)
const
;
53
54
void
setBaseUrl(
const
QUrl
&);
55
QUrl
baseUrl
()
const
;
56
57
QJSValue
importedScript(
const
QString
&
name
)
const
;
58
59
private
:
60
friend
class
QQmlEngine
;
61
friend
class
QQmlEnginePrivate
;
62
friend
class
QQmlExpression
;
63
friend
class
QQmlExpressionPrivate
;
64
friend
class
QQmlComponent
;
65
friend
class
QQmlComponentPrivate
;
66
friend
class
QQmlScriptPrivate;
67
friend
class
QQmlContextData
;
68
QQmlContext
(
QQmlContextPrivate
&dd,
QObject
*
parent
=
nullptr
);
69
QQmlContext
(
QQmlEngine
*,
bool
);
70
Q_DISABLE_COPY(
QQmlContext
)
71
};
72
QT_END_NAMESPACE
73
74
#endif
// QQMLCONTEXT_H
QJSValue
The QJSValue class acts as a container for Qt/JavaScript data types.
Definition
qjsvalue.h:31
QList
Definition
qlist.h:74
QObject
\inmodule QtCore
Definition
qobject.h:90
QQmlComponentPrivate
Definition
qqmlcomponent_p.h:40
QQmlComponent
The QQmlComponent class encapsulates a QML component definition.
Definition
qqmlcomponent.h:33
QQmlContextData
Definition
qqmlcontextdata_p.h:34
QQmlContextPrivate
Definition
qqmlcontext_p.h:34
QQmlContext
The QQmlContext class defines a context within a QML engine.
Definition
qqmlcontext.h:25
QQmlEnginePrivate
Definition
qqmlengine_p.h:108
QQmlEngine
The QQmlEngine class provides an environment for instantiating QML components.
Definition
qqmlengine.h:57
QQmlExpressionPrivate
Definition
qqmlexpression_p.h:30
QQmlExpression
The QQmlExpression class evaluates JavaScript in a QML context.
Definition
qqmlexpression.h:22
QString
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition
qstring.h:127
QUrl
\inmodule QtCore
Definition
qurl.h:94
QVariant
\inmodule QtCore
Definition
qvariant.h:64
QT_BEGIN_NAMESPACE
Combined button and popup list for selecting options.
Definition
qstandardpaths_haiku.cpp:21
QT_END_NAMESPACE
Definition
qsharedpointer.cpp:1545
properties
static const QCssKnownValue properties[NumProperties - 1]
Definition
qcssparser.cpp:38
value
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
Definition
qeglstreamconvenience_p.h:46
name
GLuint name
Definition
qopengles2ext.h:156
resolvedUrl
static QUrl resolvedUrl(const QUrl &url, const QQmlRefPointer< QQmlContextData > &context)
Definition
qquickstackview_p.cpp:171
Q_OBJECT
#define Q_OBJECT
Definition
qtmetamacros.h:117
baseUrl
QUrl baseUrl
Definition
src_corelib_io_qurl.cpp:128
engine
QJSEngine engine
[0]
Definition
src_script_qjsvalue.cpp:14
QQmlContext::PropertyPair
Definition
qqmlcontext.h:30
QQmlContext::PropertyPair::name
QString name
Definition
qqmlcontext.h:30
parent
IUIAutomationTreeWalker __RPC__deref_out_opt IUIAutomationElement ** parent
Definition
uiaclientinterfaces_p.h:209
qtdeclarative
src
qml
qml
qqmlcontext.h
Generated by
1.9.7