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
qqmljscontextproperties_p.h
Go to the documentation of this file.
1
// Copyright (C) 2025 The Qt Company Ltd.
2
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
3
// Qt-Security score:significant
4
5
#
ifndef
QQMLJSCONTEXTPROPERTIES_P_H
6
#
define
QQMLJSCONTEXTPROPERTIES_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
#
include
<
qtqmlcompilerexports
.
h
>
19
20
#
include
<
QtCore
/
qstring
.
h
>
21
#
include
<
QtCore
/
qhash
.
h
>
22
#
include
<
QtCore
/
qlist
.
h
>
23
#
include
<
QtCore
/
private
/
qflatmap_p
.
h
>
24
25
#
include
<
QtQml
/
private
/
qqmljssourcelocation_p
.
h
>
26
27
#
include
<
QtQmlToolingSettings
/
private
/
qqmltoolingsettings_p
.
h
>
28
29
QT_BEGIN_NAMESPACE
30
31
class
QSettings;
32
33
namespace
QQmlJS
{
34
class
LoggerCategory;
35
36
struct
Q_QMLCOMPILER_EXPORT
HeuristicContextProperty
37
{
38
QString
filename
= {};
39
SourceLocation
location
=
SourceLocation
{};
40
41
friend
bool
comparesEqual
(
const
HeuristicContextProperty
&
a
,
42
const
HeuristicContextProperty
&
b
)
noexcept
43
{
44
return
a
.
filename
==
b
.
filename
&&
a
.
location
==
b
.
location
;
45
}
46
Q_DECLARE_EQUALITY_COMPARABLE
(
HeuristicContextProperty
);
47
};
48
49
class
Q_QMLCOMPILER_EXPORT
HeuristicContextProperties
50
{
51
public
:
52
bool
contains
(
const
QString
&
name
)
const
{
return
m_properties
.
contains
(
name
); }
53
qsizetype
size
()
const
{
return
m_properties
.
size
(); }
54
bool
isValid
()
const
{
return
!
m_properties
.
isEmpty
(); }
55
QList
<
HeuristicContextProperty
>
definitionsForName
(
const
QString
&
name
)
const
;
56
void
writeCache
(
const
QString
&
folder
)
const
;
57
58
void
add
(
const
QString
&
name
,
const
HeuristicContextProperty
&
property
);
59
60
static
HeuristicContextProperties
collectFromCppSourceDirs
(
const
QList
<
QString
> &
cppSourceDirs
);
61
static
HeuristicContextProperties
collectFrom
(
QSettings
*
settings
);
62
63
friend
bool
comparesEqual
(
const
HeuristicContextProperties
&
a
,
64
const
HeuristicContextProperties
&
b
)
noexcept
65
{
66
return
std
::
equal
(
a
.
m_properties
.
begin
(),
a
.
m_properties
.
end
(),
b
.
m_properties
.
begin
(),
67
b
.
m_properties
.
end
());
68
}
69
Q_DECLARE_EQUALITY_COMPARABLE
(
HeuristicContextProperties
);
70
71
private
:
72
struct
Entry
73
{
74
QString
name
;
75
QList
<
HeuristicContextProperty
>
definitions
;
76
77
friend
bool
comparesEqual
(
const
Entry
&
a
,
const
Entry
&
b
)
noexcept
78
{
79
return
a
.
name
==
b
.
name
&&
a
.
definitions
==
b
.
definitions
;
80
}
81
Q_DECLARE_EQUALITY_COMPARABLE
(
Entry
);
82
};
83
84
void
collectFromDirs
(
const
QList
<
QString
> &
dirs
);
85
void
collectFromFile
(
const
QString
&
file
);
86
void
grepFallback
(
const
QList
<
QString
> &
rootUrls
);
87
#
if
QT_CONFIG
(
process
)
&&
!
defined
(
Q_OS_WINDOWS
)
88
void
parseGrepOutput
(
const
QString
&
output
);
89
#
endif
90
91
QFlatMap
<
QString
,
QList
<
HeuristicContextProperty
>>
m_properties
;
92
};
93
94
}
// namespace QQmlJS
95
96
QT_END_NAMESPACE
97
98
#
endif
// QQMLJSCONTEXTPROPERTIES_P_H
QQmlJS::HeuristicContextProperties
Definition
qqmljscontextproperties_p.h:50
QPlatformGraphicsBufferHelper
\inmodule QtGui
QQmlJS
Definition
qv4bytecodegenerator_p.h:26
QQmlJS::s_matchSetContextProperty
static const QRegularExpression s_matchSetContextProperty
Definition
qqmljscontextproperties.cpp:41
QQmlJS::cachedHeuristicListKey
static constexpr auto cachedHeuristicListKey
Definition
qqmljscontextproperties.cpp:194
QQmlJS::s_pattern
static constexpr QLatin1StringView s_pattern
Definition
qqmljscontextproperties.cpp:30
QQmlJS::s_contextPropertyNameIdxInPattern
static constexpr int s_contextPropertyNameIdxInPattern
Definition
qqmljscontextproperties.cpp:32
QQmlJS::s_fileFilters
static constexpr std::array s_fileFilters
Definition
qqmljscontextproperties.cpp:36
QQmlJS::HeuristicContextProperty
Definition
qqmljscontextproperties_p.h:37
qtdeclarative
src
qmlcompiler
qqmljscontextproperties_p.h
Generated on
for Qt by
1.14.0