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
qv4resolvedtypereference_p.h
Go to the documentation of this file.
1
// Copyright (C) 2020 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
QV4RESOLVEDTYPEREFERNCE_P_H
6
#
define
QV4RESOLVEDTYPEREFERNCE_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
<
QtQml
/
private
/
qtqmlglobal_p
.
h
>
20
#
include
<
QtQml
/
private
/
qqmlrefcount_p
.
h
>
21
#
include
<
QtQml
/
private
/
qqmlpropertycache_p
.
h
>
22
#
include
<
QtQml
/
private
/
qqmltype_p
.
h
>
23
#
include
<
QtQml
/
private
/
qv4compileddata_p
.
h
>
24
25
#
include
<
QtCore
/
qtyperevision
.
h
>
26
27
QT_BEGIN_NAMESPACE
28
29
class
QCryptographicHash;
30
namespace
QV4
{
31
32
class
ResolvedTypeReference
33
{
34
Q_DISABLE_COPY_MOVE
(
ResolvedTypeReference
)
35
public
:
36
ResolvedTypeReference
() =
default
;
37
38
QQmlPropertyCache
::
ConstPtr
createPropertyCache
();
39
bool
addToHash
(QCryptographicHash *hash, QHash<quintptr, QByteArray> *checksums);
40
41
void
doDynamicTypeCheck
();
42
43
QQmlType
type
()
const
{
return
m_type; }
44
void
setType
(QQmlType type) { m_type = std::move(type); }
45
46
// The compilation unit is stored for all composite type references that aren't
47
// self-references. It is needed both for object creation and for dependency
48
// checksum computation. Cyclic references between compilation units cannot
49
// occur because the type loader detects circular dependencies at resolution
50
// time, before buildTypeResolutionCaches runs.
51
// If the reference points to a type from the same compilation unit, it won't
52
// hold a compilation unit since the object creator can just use the one it has already.
53
QQmlRefPointer
<
QV4
::
CompiledData
::
CompilationUnit
>
compilationUnit
()
const
54
{
55
Q_ASSERT(!m_isSelfReference);
56
return
m_compilationUnit;
57
}
58
59
void
setCompilationUnit
(
const
QQmlRefPointer<QV4::CompiledData::CompilationUnit> &unit)
60
{
61
Q_ASSERT(!m_isSelfReference);
62
m_compilationUnit = unit;
63
}
64
65
QQmlPropertyCache
::
ConstPtr
typePropertyCache
()
const
{
return
m_typePropertyCache; }
66
void
setTypePropertyCache
(QQmlPropertyCache::ConstPtr cache)
67
{
68
m_typePropertyCache = std::move(cache);
69
}
70
71
QTypeRevision
version
()
const
{
return
m_version; }
72
void
setVersion
(QTypeRevision version) { m_version = version; }
73
74
bool
isFullyDynamicType
()
const
{
return
m_isFullyDynamicType; }
75
void
setFullyDynamicType
(
bool
fullyDynamic) { m_isFullyDynamicType = fullyDynamic; }
76
77
// Whether the reference points to a type from the same compilation unit. This doesn't
78
// have to be the top-level type but can also be an inline component.
79
bool
isSelfReference
()
const
{
return
m_isSelfReference; }
80
void
setIsSelfReference
(
bool
selfReference) { m_isSelfReference = selfReference; }
81
82
private
:
83
QQmlType m_type;
84
QQmlPropertyCache::ConstPtr m_typePropertyCache;
85
QQmlRefPointer<QV4::CompiledData::CompilationUnit> m_compilationUnit;
86
87
QTypeRevision m_version =
QTypeRevision
::
zero
();
88
// Types such as QQmlPropertyMap can add properties dynamically at run-time and
89
// therefore cannot have a property cache installed when instantiated.
90
bool
m_isFullyDynamicType =
false
;
91
bool
m_isSelfReference =
false
;
92
};
93
94
}
// namespace QV4
95
96
QT_END_NAMESPACE
97
98
#
endif
// QV4RESOLVEDTYPEREFERNCE_P_H
QV4::ResolvedTypeReference
Definition
qv4resolvedtypereference_p.h:33
QV4::ResolvedTypeReference::version
QTypeRevision version() const
Definition
qv4resolvedtypereference_p.h:71
QV4::ResolvedTypeReference::typePropertyCache
QQmlPropertyCache::ConstPtr typePropertyCache() const
Definition
qv4resolvedtypereference_p.h:65
QV4::ResolvedTypeReference::doDynamicTypeCheck
void doDynamicTypeCheck()
Definition
qv4resolvedtypereference.cpp:25
QV4::ResolvedTypeReference::addToHash
bool addToHash(QCryptographicHash *hash, QHash< quintptr, QByteArray > *checksums)
Definition
qv4resolvedtypereference.cpp:53
QV4::ResolvedTypeReference::isSelfReference
bool isSelfReference() const
Definition
qv4resolvedtypereference_p.h:79
QV4::ResolvedTypeReference::setFullyDynamicType
void setFullyDynamicType(bool fullyDynamic)
Definition
qv4resolvedtypereference_p.h:75
QV4::ResolvedTypeReference::setIsSelfReference
void setIsSelfReference(bool selfReference)
Definition
qv4resolvedtypereference_p.h:80
QV4::ResolvedTypeReference::compilationUnit
QQmlRefPointer< QV4::CompiledData::CompilationUnit > compilationUnit() const
Definition
qv4resolvedtypereference_p.h:53
QV4::ResolvedTypeReference::setType
void setType(QQmlType type)
Definition
qv4resolvedtypereference_p.h:44
QV4::ResolvedTypeReference::setTypePropertyCache
void setTypePropertyCache(QQmlPropertyCache::ConstPtr cache)
Definition
qv4resolvedtypereference_p.h:66
QV4::ResolvedTypeReference::setCompilationUnit
void setCompilationUnit(const QQmlRefPointer< QV4::CompiledData::CompilationUnit > &unit)
Definition
qv4resolvedtypereference_p.h:59
QV4::ResolvedTypeReference::setVersion
void setVersion(QTypeRevision version)
Definition
qv4resolvedtypereference_p.h:72
QV4::ResolvedTypeReference::type
QQmlType type() const
Definition
qv4resolvedtypereference_p.h:43
QV4::ResolvedTypeReference::isFullyDynamicType
bool isFullyDynamicType() const
Definition
qv4resolvedtypereference_p.h:74
QV4::ResolvedTypeReference::createPropertyCache
QQmlPropertyCache::ConstPtr createPropertyCache()
Definition
qv4resolvedtypereference.cpp:40
QT_BEGIN_NAMESPACE
Combined button and popup list for selecting options.
Definition
qsequentialanimationgroup.cpp:47
QV4
Definition
qjsvalue.h:24
QV4::qtTypeInherits
bool qtTypeInherits(const QMetaObject *mo)
Definition
qv4resolvedtypereference.cpp:16
qtdeclarative
src
qml
jsruntime
qv4resolvedtypereference_p.h
Generated on
for Qt by
1.18.0