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
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
<
QtCore
/
qstring
.
h
>
19
#
include
<
QtCore
/
qhash
.
h
>
20
#
include
<
QtCore
/
qlist
.
h
>
21
#
include
<
QtCore
/
private
/
qflatmap_p
.
h
>
22
23
#
include
<
QtQml
/
private
/
qqmljssourcelocation_p
.
h
>
24
25
#
include
<
QtQmlToolingSettings
/
private
/
qqmltoolingsettings_p
.
h
>
26
27
QT_BEGIN_NAMESPACE
28
29
class
QSettings;
30
31
namespace
QQmlJS
{
32
class
LoggerCategory;
33
34
struct
HeuristicContextProperty
35
{
36
QString
filename
= {};
37
SourceLocation
location
=
SourceLocation
{};
38
39
friend
bool
comparesEqual
(
const
HeuristicContextProperty
&a,
40
const
HeuristicContextProperty
&b)
noexcept
41
{
42
return
a.filename == b.filename && a.location == b.location;
43
}
44
Q_DECLARE_EQUALITY_COMPARABLE
(
HeuristicContextProperty
);
45
};
46
47
class
HeuristicContextProperties
48
{
49
public
:
50
bool
contains
(
const
QString &name)
const
{
return
m_properties.contains(name); }
51
qsizetype
size
()
const
{
return
m_properties.size(); }
52
bool
isValid
()
const
{
return
!m_properties.isEmpty(); }
53
QList
<
HeuristicContextProperty
>
definitionsForName
(
const
QString &name)
const
;
54
void
writeCache
(
const
QString &folder)
const
;
55
56
void
add
(
const
QString &name,
const
HeuristicContextProperty
&property);
57
58
static
HeuristicContextProperties
collectFromCppSourceDirs
(
const
QList<QString> &cppSourceDirs);
59
static
HeuristicContextProperties
collectFrom
(QSettings *settings);
60
61
friend
bool
comparesEqual
(
const
HeuristicContextProperties
&a,
62
const
HeuristicContextProperties
&b)
noexcept
63
{
64
return
std::equal(a.m_properties.begin(), a.m_properties.end(), b.m_properties.begin(),
65
b.m_properties.end());
66
}
67
Q_DECLARE_EQUALITY_COMPARABLE
(
HeuristicContextProperties
);
68
69
private
:
70
void
collectFromDirs(
const
QList<QString> &dirs);
71
void
collectFromFile(
const
QString &file);
72
void
grepFallback(
const
QList<QString> &rootUrls);
73
#
if
QT_CONFIG
(
process
)
&&
!
defined
(
Q_OS_WINDOWS
)
74
void
parseGrepOutput
(
const
QString
&
output
);
75
#
endif
76
77
QFlatMap
<
QString
,
QList
<
HeuristicContextProperty
>>
m_properties
;
78
};
79
80
}
// namespace QQmlJS
81
82
QT_END_NAMESPACE
83
84
#
endif
// QQMLJSCONTEXTPROPERTIES_P_H
QQmlJS::HeuristicContextProperties
Definition
qqmljscontextproperties_p.h:48
QQmlJS::HeuristicContextProperties::add
void add(const QString &name, const HeuristicContextProperty &property)
Definition
qqmljscontextproperties.cpp:47
QQmlJS::HeuristicContextProperties::contains
bool contains(const QString &name) const
Definition
qqmljscontextproperties_p.h:50
QQmlJS::HeuristicContextProperties::isValid
bool isValid() const
Definition
qqmljscontextproperties_p.h:52
QQmlJS::HeuristicContextProperties::collectFromCppSourceDirs
static HeuristicContextProperties collectFromCppSourceDirs(const QList< QString > &cppSourceDirs)
Definition
qqmljscontextproperties.cpp:99
QQmlJS::HeuristicContextProperties::size
qsizetype size() const
Definition
qqmljscontextproperties_p.h:51
QQmlJS::HeuristicContextProperties::comparesEqual
friend bool comparesEqual(const HeuristicContextProperties &a, const HeuristicContextProperties &b) noexcept
Definition
qqmljscontextproperties_p.h:61
QQmlJS::HeuristicContextProperties::collectFrom
static HeuristicContextProperties collectFrom(QSettings *settings)
Definition
qqmljscontextproperties.cpp:193
QQmlJS::HeuristicContextProperties::writeCache
void writeCache(const QString &folder) const
Definition
qqmljscontextproperties.cpp:226
QQmlJS::HeuristicContextProperties::definitionsForName
QList< HeuristicContextProperty > definitionsForName(const QString &name) const
Definition
qqmljscontextproperties.cpp:39
QQmlJS
Definition
qv4bytecodegenerator_p.h:27
QQmlJS::s_matchSetContextProperty
static const QRegularExpression s_matchSetContextProperty
Definition
qqmljscontextproperties.cpp:35
QQmlJS::s_pattern
static constexpr QLatin1StringView s_pattern
Definition
qqmljscontextproperties.cpp:31
QQmlJS::s_contextPropertyNameIdxInPattern
static constexpr int s_contextPropertyNameIdxInPattern
Definition
qqmljscontextproperties.cpp:33
QT_BEGIN_NAMESPACE
Combined button and popup list for selecting options.
Definition
qsequentialanimationgroup.cpp:47
QQmlJS::HeuristicContextProperty
Definition
qqmljscontextproperties_p.h:35
QQmlJS::HeuristicContextProperty::filename
QString filename
Definition
qqmljscontextproperties_p.h:36
QQmlJS::HeuristicContextProperty::location
SourceLocation location
Definition
qqmljscontextproperties_p.h:37
QQmlJS::HeuristicContextProperty::comparesEqual
friend bool comparesEqual(const HeuristicContextProperty &a, const HeuristicContextProperty &b) noexcept
Definition
qqmljscontextproperties_p.h:39
qtdeclarative
src
qmllint
qqmljscontextproperties_p.h
Generated on
for Qt by
1.18.0